feat(frontend): add recording matching UI
Add frontend components for auto-matching recording partners: - RecordingTab component with suggestions list and opt-out toggle - Tab navigation in EventChatPage (Chat, Uczestnicy, Nagrywanie) - Matching configuration in EventDetailsPage (deadline, run matching) - matchingAPI functions in api.js - Return registrationDeadline and matchingRunAt in GET /events/:slug/details UI allows users to: - View who will record their heats - View heats they need to record - Accept/reject suggestions - Opt-out from being a recorder - Set registration deadline (admin) - Manually trigger matching (admin)
This commit is contained in:
@@ -388,4 +388,48 @@ export const dashboardAPI = {
|
||||
},
|
||||
};
|
||||
|
||||
// Recording Matching API (Auto-matching for recording partners)
|
||||
export const matchingAPI = {
|
||||
// Get match suggestions for current user
|
||||
async getSuggestions(slug) {
|
||||
const data = await fetchAPI(`/events/${slug}/match-suggestions`);
|
||||
return data.data;
|
||||
},
|
||||
|
||||
// Run matching algorithm (admin/trigger)
|
||||
async runMatching(slug) {
|
||||
const data = await fetchAPI(`/events/${slug}/run-matching`, {
|
||||
method: 'POST',
|
||||
});
|
||||
return data.data;
|
||||
},
|
||||
|
||||
// Accept or reject a suggestion
|
||||
async updateSuggestionStatus(slug, suggestionId, status) {
|
||||
const data = await fetchAPI(`/events/${slug}/match-suggestions/${suggestionId}/status`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ status }),
|
||||
});
|
||||
return data.data;
|
||||
},
|
||||
|
||||
// Set recorder opt-out preference
|
||||
async setRecorderOptOut(slug, optOut) {
|
||||
const data = await fetchAPI(`/events/${slug}/recorder-opt-out`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ optOut }),
|
||||
});
|
||||
return data.data;
|
||||
},
|
||||
|
||||
// Set registration deadline (admin)
|
||||
async setRegistrationDeadline(slug, deadline) {
|
||||
const data = await fetchAPI(`/events/${slug}/registration-deadline`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ registrationDeadline: deadline }),
|
||||
});
|
||||
return data.data;
|
||||
},
|
||||
};
|
||||
|
||||
export { ApiError };
|
||||
|
||||
Reference in New Issue
Block a user