Objective
A logged in admin should be able to reassign a submitted artwork. We need to allow "guests" to upload tickets too. This means, they will not have an account in our system. Admins should be able to take any uploaded artwork and reassign it to some other registered profile. This one is tricky and we'll need to see how the system reacts when an anonymous user uploads an artwork. My guess is that the user_id foreign key will be None for such pieces of artwork. Think about what else we need for this endpoint. We must supply an additional parameter which will be the actual registered user we're reassigning to.
Tasks
Backend
Check out the structure of the artworks table, what fields exist, etc
Follow instructions in the route.ts file for this endpoint (within /api)
Study what are the correct response headers, status codes, and messaging for this endpoint. Some starters exist within the /constants directory. Feel free to use them or change them while understanding that we should strive for consistency across our messages
Acceptance Criteria
✅ A call to the endpoint (using a tool like postman) will modify the required fields
✅ Only a logged in admin can utilize the API
✅ Study what response status codes and messaging is most helpful (our frontend will process this and we'll use them to show end users what just happened and why!!)
✅ You're able to understand what makes a PATCH request different from a POST. Is this the right one to use here?
Resource(s)
Existing Prisma schema
Existing DB table design
https://restfulapi.net/http-status-codes/
Objective
A logged in admin should be able to reassign a submitted artwork. We need to allow "guests" to upload tickets too. This means, they will not have an account in our system. Admins should be able to take any uploaded artwork and reassign it to some other registered profile. This one is tricky and we'll need to see how the system reacts when an anonymous user uploads an artwork. My guess is that the user_id foreign key will be None for such pieces of artwork. Think about what else we need for this endpoint. We must supply an additional parameter which will be the actual registered user we're reassigning to.
Tasks
Backend
Check out the structure of the artworks table, what fields exist, etc
Follow instructions in the route.ts file for this endpoint (within /api)
Study what are the correct response headers, status codes, and messaging for this endpoint. Some starters exist within the /constants directory. Feel free to use them or change them while understanding that we should strive for consistency across our messages
Acceptance Criteria
✅ A call to the endpoint (using a tool like postman) will modify the required fields
✅ Only a logged in admin can utilize the API
✅ Study what response status codes and messaging is most helpful (our frontend will process this and we'll use them to show end users what just happened and why!!)
✅ You're able to understand what makes a PATCH request different from a POST. Is this the right one to use here?
Resource(s)
Existing Prisma schema
Existing DB table design
https://restfulapi.net/http-status-codes/