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

Commit

Permalink
Delete tag working
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarlow12 authored and wbreza committed Apr 19, 2019
1 parent 57f430f commit 3322363
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/services/assetService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export class AssetService {
return;
}
const assetKeys = Object.keys(assets);
let result: IAssetMetadata;

// Loop over assets and update if necessary
await assetKeys.forEachAsync(async (assetKey) => {
Expand All @@ -255,29 +256,12 @@ export class AssetService {
const updatedAssetMetadata = this.updateTagInAssetMetadata(assetMetadata, tagName, transformer);
if (updatedAssetMetadata) {
await this.save(updatedAssetMetadata);
if (currentAsset && currentAsset.asset.id === updatedAssetMetadata.asset.id) {
result = updatedAssetMetadata;
}
}
});

// for (const assetKey of assetKeys) {
// const asset = assets[assetKey];
// if (asset.state !== AssetState.Tagged) {
// debugger;
// return;
// }
// const assetMetadata = await this.getAssetMetadata(asset);
// debugger;
// const updatedAssetMetadata = this.updateTagInAssetMetadata(assetMetadata, tagName, transformer);
// debugger;
// if (updatedAssetMetadata) {
// await this.save(updatedAssetMetadata);
// }
// }

if (currentAsset) {
const asset = this.updateTagInAssetMetadata(currentAsset, tagName, transformer);
debugger;
return asset;
}
return result;
}

/**
Expand Down

0 comments on commit 3322363

Please sign in to comment.