This PR adds a new API endpoint for renaming a recording in the Supertonic application. The endpoint allows users to update the name of a recording by providing the recording ID and the new name.
Changes Made
Added a new method renameRecording in the UserService class (server/src/users/user.service.ts) to handle the renaming of a recording. This method interacts with the Prisma service to update the name of the recording in the database.
Added a new API endpoint (PATCH /recordings/:id) in the UserController class (server/src/users/user.controller.ts) that calls the renameRecording method in the UserService. This endpoint takes in the recording ID as a path parameter and the new name as a request body parameter.
How to Test
Start the Supertonic application.
Use an API testing tool (e.g., Postman) to send a PATCH request to the /recordings/:id endpoint, where :id is the ID of the recording you want to rename.
In the request body, include the new name for the recording.
Verify that the recording name is updated in the database.
Description
This PR adds a new API endpoint for renaming a recording in the Supertonic application. The endpoint allows users to update the name of a recording by providing the recording ID and the new name.
Changes Made
renameRecording
in theUserService
class (server/src/users/user.service.ts) to handle the renaming of a recording. This method interacts with the Prisma service to update the name of the recording in the database.UserController
class (server/src/users/user.controller.ts) that calls therenameRecording
method in theUserService
. This endpoint takes in the recording ID as a path parameter and the new name as a request body parameter.How to Test
/recordings/:id
endpoint, where:id
is the ID of the recording you want to rename.Related Issue
Add a new API endpoint for renaming a recording
Fixes #11.
To checkout this PR branch, run the following command in your terminal: