OS: darwin-arm64
Strapi Version: 5.1.0
Node/Yarn Version: npm/10.6.0 node/v22.0.0 darwin arm64 workspaces/false
Edition: Community
Database: postgres
In project: Typescript
Describe the bug
During the update of the saved_attractions field, an error occurs when sending a request with documentId to associate attractions in the user model in Strapi. The error message reads:
Expected a valid Number, got zci5jswm0m1r7hdlg343j50y
Error: Expected a valid Number, got zci5jswm0m1r7hdlg343j50y
The error does not occur when sending the id from the attractions table instead of documentId.
Steps to reproduce the behavior
Go to the Strapi API endpoint /user/me for the user model.
Send a PUT request to update the saved_attractions field with documentId.
Observe the error message that appears.
Expected behavior
The saved_attractions field should be updated without error when using documentId, similarly to when using the id from the attractions table.
Code snippets
Here’s the function used to update the user in the user-permission extension.
The bug is triggered when the PUT /user/me request, created within the user-permission extension in Strapi, includes the saved_attractions array with documentId. The issue seems to stem from expecting a id instead of the documentId.
Bug report
Required System information
OS: darwin-arm64 Strapi Version: 5.1.0 Node/Yarn Version: npm/10.6.0 node/v22.0.0 darwin arm64 workspaces/false Edition: Community Database: postgres In project: Typescript
Describe the bug
During the update of the saved_attractions field, an error occurs when sending a request with documentId to associate attractions in the user model in Strapi. The error message reads:
The error does not occur when sending the id from the attractions table instead of documentId.
Steps to reproduce the behavior
Expected behavior
The saved_attractions field should be updated without error when using documentId, similarly to when using the id from the attractions table.
Code snippets
Here’s the function used to update the user in the user-permission extension.
Here's the body of the PUT request to /user/me
Additional context
The bug is triggered when the PUT /user/me request, created within the user-permission extension in Strapi, includes the saved_attractions array with documentId. The issue seems to stem from expecting a id instead of the documentId.