@b2y/ecommerce-common 1.2.3 → 1.2.5

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.
@@ -21,6 +21,7 @@ const getAllSubscriptionPlans = (
21
21
  "Currency",
22
22
  "TrialPeriodDays",
23
23
  "IsActive",
24
+ "SortOrder"
24
25
  ],
25
26
  include: [
26
27
  {
@@ -94,7 +94,7 @@ return async (req, res) => {
94
94
  }
95
95
  }}
96
96
 
97
- const updateTenantSettings = (TenantSettings, multer, upload, FileUploadUtil, FILE_PATHS, UpdatedBy, sequelize, logger) => {
97
+ const updateTenantSettings = (TenantSettings, multer, upload, FileUploadUtil, FILE_PATHS, reqUpdatedBy, sequelize, logger) => {
98
98
  return async (req, res) => {
99
99
  upload(req, res, async (err) => {
100
100
  if (err instanceof multer.MulterError || err) {
@@ -171,7 +171,14 @@ return async (req, res) => {
171
171
  // Update tenant settings
172
172
  const updatePayload = {};
173
173
  if (ThemeColour !== undefined) updatePayload.ThemeColour = ThemeColour;
174
- updatePayload.UpdatedBy = UpdatedBy;
174
+ let updatedBy = null
175
+ if(reqUpdatedBy) {
176
+ updatedBy = reqUpdatedBy;
177
+ }
178
+ else {
179
+ updatedBy = req.user.UserID
180
+ }
181
+ updatePayload.UpdatedBy = updatedBy
175
182
  updatePayload.UpdatedAt = new Date();
176
183
 
177
184
  await existingSettings.update(updatePayload, { transaction });
@@ -185,7 +192,7 @@ return async (req, res) => {
185
192
  EntityTypeEnum.TENANT_SETTINGS,
186
193
  existingSettings.TenantSettingID,
187
194
  existingSettings.TenantID,
188
- UpdatedBy,
195
+ updatedBy,
189
196
  transaction
190
197
  );
191
198
  }
@@ -40,6 +40,10 @@ module.exports = (sequelize) => {
40
40
  type: DataTypes.BOOLEAN,
41
41
  defaultValue: true,
42
42
  },
43
+ SortOrder: {
44
+ type: DataTypes.INTEGER,
45
+ allowNull: false
46
+ },
43
47
  CreatedBy: {
44
48
  type: DataTypes.UUID,
45
49
  allowNull: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b2y/ecommerce-common",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "E-commerce common library",
5
5
  "main": "index.js",
6
6
  "scripts": {