refactor: migrate stacks (#17559)

chore: migrate stacks
This commit is contained in:
Daniel Dietzler
2025-04-12 14:33:35 +02:00
committed by GitHub
parent 5dac315af7
commit a373034629
11 changed files with 153 additions and 63 deletions

View File

@@ -203,7 +203,7 @@ export class AssetService extends BaseService {
// Replace the parent of the stack children with a new asset
if (asset.stack?.primaryAssetId === id) {
const stackAssetIds = asset.stack.assets.map((a) => a.id);
const stackAssetIds = asset.stack?.assets.map((a) => a.id) ?? [];
if (stackAssetIds.length > 2) {
const newPrimaryAssetId = stackAssetIds.find((a) => a !== id)!;
await this.stackRepository.update(asset.stack.id, {