Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit 3322363

Browse files
tbarlow12wbreza
authored andcommitted
Delete tag working
1 parent 57f430f commit 3322363

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/services/assetService.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ export class AssetService {
247247
return;
248248
}
249249
const assetKeys = Object.keys(assets);
250+
let result: IAssetMetadata;
250251

251252
// Loop over assets and update if necessary
252253
await assetKeys.forEachAsync(async (assetKey) => {
@@ -255,29 +256,12 @@ export class AssetService {
255256
const updatedAssetMetadata = this.updateTagInAssetMetadata(assetMetadata, tagName, transformer);
256257
if (updatedAssetMetadata) {
257258
await this.save(updatedAssetMetadata);
259+
if (currentAsset && currentAsset.asset.id === updatedAssetMetadata.asset.id) {
260+
result = updatedAssetMetadata;
261+
}
258262
}
259263
});
260-
261-
// for (const assetKey of assetKeys) {
262-
// const asset = assets[assetKey];
263-
// if (asset.state !== AssetState.Tagged) {
264-
// debugger;
265-
// return;
266-
// }
267-
// const assetMetadata = await this.getAssetMetadata(asset);
268-
// debugger;
269-
// const updatedAssetMetadata = this.updateTagInAssetMetadata(assetMetadata, tagName, transformer);
270-
// debugger;
271-
// if (updatedAssetMetadata) {
272-
// await this.save(updatedAssetMetadata);
273-
// }
274-
// }
275-
276-
if (currentAsset) {
277-
const asset = this.updateTagInAssetMetadata(currentAsset, tagName, transformer);
278-
debugger;
279-
return asset;
280-
}
264+
return result;
281265
}
282266

283267
/**

0 commit comments

Comments
 (0)