-
Notifications
You must be signed in to change notification settings - Fork 236
fix(admin): Cannot change file upload destination to "MongoDB (GridFS)" or "local" #10118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(admin): Cannot change file upload destination to "MongoDB (GridFS)" or "local" #10118
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds explicit handling for switching the file upload destination to “local” or “gridfs” (MongoDB) by updating the configuration accordingly.
- Introduce a new
ifblock to callconfigManager.updateConfigsforlocalandgridfstypes - Wrap the update in a try/catch to surface errors via the API
Comments suppressed due to low confidence (2)
apps/app/src/server/routes/apiv3/app-settings.js:902
- [nitpick] The error code string
update-fileUploadType-failedmixes camelCase and kebab-case. Consider renaming it toupdate-file-upload-type-failedto match existing conventions.
return res.apiv3Err(new ErrorV3(msg, 'update-fileUploadType-failed'));
apps/app/src/server/routes/apiv3/app-settings.js:893
- Add unit or integration tests to cover changing the
fileUploadTypetolocalandgridfs, ensuringconfigManager.updateConfigsis called and the API response is returned as expected.
if (fileUploadType === 'local' || fileUploadType === 'gridfs') {
| logger.error('Error', err); | ||
| return res.apiv3Err(new ErrorV3(msg, 'update-fileUploadType-failed')); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ファイルアップロード先が "local" or "gridfs" の時に config 値を変更していなかったことが原因
Task