Commit 61a4799c authored by nanahira's avatar nanahira

fix

parent 3dc816e7
Pipeline #5030 passed with stages
in 4 minutes and 25 seconds
import { ConsoleLogger, Injectable } from '@nestjs/common';
import { InjectConnection } from '@nestjs/typeorm';
import { Connection, IsNull, Not, SelectQueryBuilder } from 'typeorm';
import { Brackets, Connection, IsNull, Not, SelectQueryBuilder } from 'typeorm';
import { App } from '../entities/App.entity';
import { DepotDto } from '../dto/Depot.dto';
import { Build } from '../entities/Build.entity';
......@@ -35,10 +35,10 @@ export class UpdateService extends ConsoleLogger {
if (platform === 'generic') {
continue;
}
const depotDto = new DepotDto();
/*const depotDto = new DepotDto();
depotDto.locale = 'generic';
depotDto.arch = 'generic';
depotDto.platform = platform;
depotDto.platform = platform;*/
// this.log(platform);
for (const app of data) {
if (app.version && app.version[platform] === '_latest') {
......@@ -54,7 +54,7 @@ export class UpdateService extends ConsoleLogger {
.select(['build.version', 'build.id', 'depot.platform'])
.innerJoin('build.depot', 'depot')
.where('depot.appId = :appId', { appId: app.id })
.andWhere(depotDto.getQueryBrackets())
.andWhere(new Brackets((qb) => qb.where('depot.platform = "generic"').orWhere('depot.platform = :platform', { platform })))
.orderBy('build.id', 'DESC')
.take(1)
.getOne();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment