@kipicore/dbcore 1.1.339 → 1.1.340

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.
@@ -55,8 +55,14 @@ class FileStorageModel extends sequelize_1.Model {
55
55
  return;
56
56
  const instanceArray = Array.isArray(instances) ? instances : [instances];
57
57
  await Promise.all(instanceArray.map(async (instance) => {
58
- const signedUrl = await (0, helpers_1.getPresignedUrl)(configs_1.ENV_VARIABLE.AWS_BUCKET_NAME, instance.get());
59
- instance.setDataValue('filePath', signedUrl);
58
+ const data = typeof instance.get === 'function' ? instance.get() : instance;
59
+ const signedUrl = await (0, helpers_1.getPresignedUrl)(configs_1.ENV_VARIABLE.AWS_BUCKET_NAME, data);
60
+ if (typeof instance.setDataValue === 'function') {
61
+ instance.setDataValue('filePath', signedUrl);
62
+ }
63
+ else {
64
+ instance.filePath = signedUrl;
65
+ }
60
66
  }));
61
67
  });
62
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.339",
3
+ "version": "1.1.340",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",