Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions backend/src/routes/coreRoutes/coreApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ router
router
.route('/setting/upload/:settingKey?')
.patch(
catchErrors(
singleStorageUpload({ entity: 'setting', fieldName: 'settingValue', fileType: 'image' })
),
singleStorageUpload({ entity: 'setting', fieldName: 'settingValue', fileType: 'image' }),
catchErrors(settingController.updateBySettingKey)
);
router.route('/setting/updateManySetting').patch(catchErrors(settingController.updateManySetting));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { selectSettings } from '@/redux/settings/selectors';
import { Button, Form } from 'antd';
import Loading from '@/components/Loading';
import useLanguage from '@/locale/useLanguage';
import { notification } from 'antd';

export default function UpdateSettingForm({ config, children, withUpload, uploadSettingKey }) {
let { entity, settingsCategory } = config;
Expand All @@ -20,7 +21,12 @@ export default function UpdateSettingForm({ config, children, withUpload, upload
if (withUpload) {
if (fieldsValue.file) {
fieldsValue.file = fieldsValue.file[0].originFileObj;
}
} else {
notification.error({
message: translate('Please select a file to upload.'),
});
return;
}
dispatch(
settingsAction.upload({ entity, settingKey: uploadSettingKey, jsonData: fieldsValue })
);
Expand All @@ -35,6 +41,9 @@ export default function UpdateSettingForm({ config, children, withUpload, upload
}
};




useEffect(() => {
const current = result[settingsCategory];

Expand Down