feat(asset): refactor version stack to surface latest metadata and add UI support

This commit is contained in:
yiling
2026-05-22 23:03:29 +08:00
parent 9128517492
commit 0ac075539b
9 changed files with 251 additions and 117 deletions
+5 -4
View File
@@ -29,18 +29,19 @@ export class SearchService {
where.parentId = { in: targetFolderIds }
}
const targetType = req.assetType === 'folder' ? AssetType.folder : AssetType.file
const targetTypes =
req.assetType === 'folder' ? [AssetType.folder] : [AssetType.file, AssetType.version_stack]
const typeCondition: Prisma.AssetWhereInput = req.showSymlink
? {
OR: [
{ type: targetType },
{ type: { in: targetTypes } },
{
type: AssetType.symlink,
target: { type: targetType },
target: { type: { in: targetTypes } },
},
],
}
: { type: targetType }
: { type: { in: targetTypes } }
if (req.conditions && req.conditions.length > 0) {
const conditionPredicates: Prisma.AssetWhereInput[] = req.conditions.map((cond) => {