@b2y/ecommerce-common 1.2.4 → 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.
|
@@ -94,7 +94,7 @@ return async (req, res) => {
|
|
|
94
94
|
}
|
|
95
95
|
}}
|
|
96
96
|
|
|
97
|
-
const updateTenantSettings = (TenantSettings, multer, upload, FileUploadUtil, FILE_PATHS,
|
|
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,12 +171,14 @@ return async (req, res) => {
|
|
|
171
171
|
// Update tenant settings
|
|
172
172
|
const updatePayload = {};
|
|
173
173
|
if (ThemeColour !== undefined) updatePayload.ThemeColour = ThemeColour;
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
let updatedBy = null
|
|
175
|
+
if(reqUpdatedBy) {
|
|
176
|
+
updatedBy = reqUpdatedBy;
|
|
176
177
|
}
|
|
177
178
|
else {
|
|
178
|
-
|
|
179
|
+
updatedBy = req.user.UserID
|
|
179
180
|
}
|
|
181
|
+
updatePayload.UpdatedBy = updatedBy
|
|
180
182
|
updatePayload.UpdatedAt = new Date();
|
|
181
183
|
|
|
182
184
|
await existingSettings.update(updatePayload, { transaction });
|
|
@@ -190,7 +192,7 @@ return async (req, res) => {
|
|
|
190
192
|
EntityTypeEnum.TENANT_SETTINGS,
|
|
191
193
|
existingSettings.TenantSettingID,
|
|
192
194
|
existingSettings.TenantID,
|
|
193
|
-
|
|
195
|
+
updatedBy,
|
|
194
196
|
transaction
|
|
195
197
|
);
|
|
196
198
|
}
|