diff --git a/backend/src/routes/events.js b/backend/src/routes/events.js index 0b0b832..f0d25e3 100644 --- a/backend/src/routes/events.js +++ b/backend/src/routes/events.js @@ -1249,14 +1249,14 @@ router.put('/:slug/match-suggestions/:suggestionId/status', authenticate, async }); } - // Check authorization: only dancer or recorder can update status - const isDancer = suggestion.heat.userId === userId; + // Check authorization: only recorder can update status (MVP decision) + // Dancer can only view who is assigned to record them const isRecorder = suggestion.recorderId === userId; - if (!isDancer && !isRecorder) { + if (!isRecorder) { return res.status(403).json({ success: false, - error: 'You are not authorized to update this suggestion', + error: 'Only the assigned recorder can accept or reject this suggestion', }); } diff --git a/frontend/src/components/recordings/RecordingTab.jsx b/frontend/src/components/recordings/RecordingTab.jsx index b0214cc..cca7232 100644 --- a/frontend/src/components/recordings/RecordingTab.jsx +++ b/frontend/src/components/recordings/RecordingTab.jsx @@ -291,6 +291,13 @@ const SuggestionCard = ({ suggestion, type, onAccept, onReject, navigate }) => { // Status badge const getStatusBadge = () => { switch (status) { + case SUGGESTION_STATUS.PENDING: + return ( + + + Pending + + ); case SUGGESTION_STATUS.ACCEPTED: return ( @@ -359,24 +366,8 @@ const SuggestionCard = ({ suggestion, type, onAccept, onReject, navigate }) => {
- {status === SUGGESTION_STATUS.PENDING ? ( - <> - - - - ) : ( + {/* Dancers (TO_BE_RECORDED) can only view status, not update it */} + {type === SUGGESTION_TYPE.TO_BE_RECORDED ? ( <> {getStatusBadge()} {status === SUGGESTION_STATUS.ACCEPTED && match?.slug && ( @@ -389,6 +380,39 @@ const SuggestionCard = ({ suggestion, type, onAccept, onReject, navigate }) => { )} + ) : ( + /* Recorders (TO_RECORD) can accept/reject */ + status === SUGGESTION_STATUS.PENDING ? ( + <> + + + + ) : ( + <> + {getStatusBadge()} + {status === SUGGESTION_STATUS.ACCEPTED && match?.slug && ( + + )} + + ) )}