@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.
|
@@ -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,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
|
-
|
|
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
|
-
|
|
195
|
+
updatedBy,
|
|
189
196
|
transaction
|
|
190
197
|
);
|
|
191
198
|
}
|