@communecter/cocolight-api-client 1.0.65 → 1.0.66

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": "@communecter/cocolight-api-client",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
package/src/api/News.ts CHANGED
@@ -252,12 +252,12 @@ export class News extends BaseEntity<NewsItemNormalized> {
252
252
  },
253
253
  newsFile: validatedFile as any
254
254
  };
255
- const dataFile = await this.callIsConnected(() => this.endpointApi.addFileNews(data));
255
+ const dataFile = await this.callIsConnected(() => this.endpointApi.addFileNews(data)) as { id: string; [key: string]: any };
256
256
  if (this._draftData.mediaFile) {
257
257
  this._draftData.mediaFile.countFiles = this._draftData.mediaFile.countFiles + 1;
258
- this._draftData.mediaFile.files.push(dataFile);
258
+ this._draftData.mediaFile.files.push(dataFile.id);
259
259
  } else {
260
- this._draftData.mediaFile = { countFiles: 1, files: [dataFile] };
260
+ this._draftData.mediaFile = { countFiles: 1, files: [dataFile.id] };
261
261
  }
262
262
  return dataFile;
263
263
  }