Skip to content

Conversation

@miya
Copy link
Member

@miya miya commented Jun 27, 2025

Task

  • #168146 ファイルアップロード先を MongoDB or local に変更できない

@miya miya requested review from Copilot and yuki-takei June 27, 2025 09:24
@miya miya self-assigned this Jun 27, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 27, 2025

⚠️ No Changeset found

Latest commit: fca3f6a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@miya miya changed the title fix: Cannot change file upload destination to "MongoDB ()" or "local" fix: Cannot change file upload destination to "MongoDB (GridFS))" or "local" Jun 27, 2025
@miya miya changed the title fix: Cannot change file upload destination to "MongoDB (GridFS))" or "local" fix: Cannot change file upload destination to "MongoDB (GridFS)" or "local" Jun 27, 2025
Copy link
Contributor

Copilot AI left a 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 if block to call configManager.updateConfigs for local and gridfs types
  • 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-failed mixes camelCase and kebab-case. Consider renaming it to update-file-upload-type-failed to 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 fileUploadType to local and gridfs, ensuring configManager.updateConfigs is 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'));
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ファイルアップロード先が "local" or "gridfs" の時に config 値を変更していなかったことが原因

@yuki-takei yuki-takei merged commit f22c76a into master Jun 28, 2025
39 of 45 checks passed
@yuki-takei yuki-takei deleted the fix/168147-cannot-change-file-upload-destination-to-mongodb-or-local branch June 28, 2025 16:06
@github-actions github-actions bot mentioned this pull request Jun 28, 2025
@yuki-takei yuki-takei changed the title fix: Cannot change file upload destination to "MongoDB (GridFS)" or "local" fix(admin): Cannot change file upload destination to "MongoDB (GridFS)" or "local" Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants