fix(server): stack info in asset response for mobile (#7346)

* fix(server): stack info in asset response for mobile

* fix(server): getAllAssets - do not filter by stack ID

* tet(server): GET /assets stack e2e

* chore(server): fix checks

* stack asset height

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
Alex 2024-03-05 23:44:56 -06:00 committed by GitHub
parent 4c0bb2308c
commit 52dfe5fc92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 37 additions and 24 deletions

View file

@ -2,7 +2,6 @@ import { AssetSearchBuilderOptions, Paginated, PaginationOptions } from '@app/do
import _ from 'lodash';
import {
Between,
Brackets,
FindManyOptions,
IsNull,
LessThanOrEqual,
@ -229,12 +228,7 @@ export function searchAssetBuilder(
}
if (withStacked) {
builder
.leftJoinAndSelect(`${builder.alias}.stack`, 'stack')
.leftJoinAndSelect('stack.assets', 'stackedAssets')
.andWhere(
new Brackets((qb) => qb.where(`stack.primaryAssetId = ${builder.alias}.id`).orWhere('asset.stackId IS NULL')),
);
builder.leftJoinAndSelect(`${builder.alias}.stack`, 'stack').leftJoinAndSelect('stack.assets', 'stackedAssets');
}
const withDeleted = options.withDeleted ?? (trashedAfter !== undefined || trashedBefore !== undefined);