-
-
Notifications
You must be signed in to change notification settings - Fork 568
feat: User API request to allow admins to submit requests on behalf of users #2319
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
base: develop
Are you sure you want to change the base?
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 enables admins to submit media requests on behalf of other users, allowing requests to be routed through the approval queue rather than being automatically approved. Additionally, it fixes a bug where undefined is4k parameters caused duplicate request issues.
Changes:
- Added new POST endpoint
/user/{userId}/requestthat requires ADMIN permission - Fixed is4k query bug in MediaRequest entity that caused issues when the is4k parameter was not supplied
- Updated API documentation to include the new endpoint
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| server/routes/user/index.ts | Adds new POST endpoint for admins to submit requests on behalf of users with proper authentication and error handling |
| server/entity/MediaRequest.ts | Fixes is4k query parameter handling to convert undefined values to false |
| seerr-api.yml | Documents the new endpoint with request/response schemas and descriptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
If nothing came out of the command that's because you did not introduce any new string in the UI so don't worry about this. However, before each commit you must run |
It changed line 9 of code in index.ts: Do I need to do another pull request for this? |
Nope, just push the change. |
|
Thanks for the contribution! I know this might seem nitpicky, but we do need to address the commit formatting before merging. Per our contributing guidelines, all commits must follow the Conventional Commits standard (e.g., feat: add feature, fix: resolve bug, docs: update readme). This is mandatory as this helps us maintain a clean, readable project history and automate our changelog generation. Could you please either amend your commits or squash them into properly formatted ones? And please utilise meaningful commit messages instead of just The branch name also doesn't match our convention, but that's fine since you can't change it once the PR is open, but just something to keep in mind for next time. Once the commits are updated, we'll be happy to review after the feature freeze is lifted. Let me know if you have any questions! 😄 |
|
Thanks @0xSysR3ll . I was able to push the changes recommended by copilot check as well. |
OK that was a journey, but I think I squashed the commits and renamed them suiting the preferred style. |
Description
Users with the ADMIN permission are now able to request media on behalf of other users. The request appears as if the user themself had requested the content. The endpoint works from POST /user/{userId}/request and has been added to the API-docs. The new functionality allows requests to be routed to the approval queue when an admin submits the requests on behalf of a user, whereas the /request endpoint would automatically approve them.
I created a new endpoint for admins to submit requests on behalf of users, as mentioned in the last post of this thread: #2173
I also fixed a minor bug discovered while testing. The is4k check for MediaRequests caused the API to request multiple times if the is4k parameter was not supplied.
How Has This Been Tested?
I tested this on Docker for Windows using Jellyfin v10.11.6 and Jellyseerr develop version (with my committed changes).
Screenshots / Logs (if applicable)
[201: success] When logged in as user with ADMIN permission, executing on another user ID=2:

[403 error: unauthorized] When logged in as a user without ADMIN permission, executing on another user ID=1:

[403 error: unauthorized] When logged in as a user without ADMIN permission, executing on same user ID=2:

[201: success] When requesting via the API authentication:

Checklist:
I ran the translation keys code, but I'm not sure what to do with it. There were no compile errors.
pnpm buildpnpm i18n:extract