@imposium-hub/components 1.43.3 → 1.43.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imposium-hub/components",
3
- "version": "1.43.3",
3
+ "version": "1.43.4",
4
4
  "description": "React & Typescript component / asset library for Imposium front-ends",
5
5
  "main": "dist/components.js",
6
6
  "scripts": {
@@ -88,7 +88,7 @@ export const addAssetTag = (api : IImposiumAPI, id : string, tags : string, stor
88
88
  resolve();
89
89
  }
90
90
 
91
- if (freshTags.length > 0) {
91
+ if (freshTags.length === 1) {
92
92
  promises = freshTags.map((t) => (
93
93
  api.addAssetTag(id, t)
94
94
  .then(() => resolve())
@@ -102,6 +102,14 @@ export const addAssetTag = (api : IImposiumAPI, id : string, tags : string, stor
102
102
 
103
103
  dispatch({type: assetActions.ADD_TAG, id, freshTags});
104
104
  }
105
+
106
+ if (freshTags.length > 1 ) {
107
+ api.addAssetTags(id, freshTags)
108
+ .then(() => resolve())
109
+ .catch((e) => resolve(e));
110
+
111
+ dispatch({type: assetActions.ADD_TAG, id, freshTags});
112
+ }
105
113
  });
106
114
  };
107
115
  };
package/services/API.ts CHANGED
@@ -433,7 +433,7 @@ export default class API {
433
433
  });
434
434
  }
435
435
 
436
- public addAssetTag = (assetId : string, tag : string) : Promise<any | Error> => {
436
+ public addAssetTag = (assetId : string, tag : any) : Promise<any | Error> => {
437
437
  return this.doRequest({
438
438
  method: 'POST',
439
439
  url: `/assets/${assetId}/tag`,
@@ -441,6 +441,14 @@ export default class API {
441
441
  });
442
442
  }
443
443
 
444
+ public addAssetTags = (assetId : string, tags : any) : Promise<any | Error> => {
445
+ return this.doRequest({
446
+ method: 'POST',
447
+ url: `/assets/${assetId}/tags`,
448
+ data: {tags}
449
+ });
450
+ }
451
+
444
452
  public deleteAssetTag = (assetId : string, tag : string) : Promise<any | Error> => {
445
453
  return this.doRequest({
446
454
  method: 'DELETE',