feat: review

This commit is contained in:
moolcoov
2025-03-03 15:55:44 +03:00
parent 219cba64c0
commit f5a3fc1fdc
10 changed files with 471 additions and 114 deletions
@@ -15,6 +15,6 @@ export const getCompetition = async (id: string) => {
export const startCompetition = async (competitionId: string) => {
return await userFetch(`/competitions/${competitionId}/start`, {
method: 'POST'
method: "POST",
});
};
};
+19 -2
View File
@@ -1,12 +1,29 @@
import { apiFetch } from ".";
import { Review, Reviewer } from "../types/review";
import { Review, Reviewer, ReviewEvaluation } from "../types/review";
export const getReviewer = async (token: string) => {
return await apiFetch<Reviewer>(`/review/${token}`);
};
export const getReviewerSubmissions = async (token: string) => {
export const getReviewSubmissions = async (token: string) => {
return await apiFetch<{ submissions: Review[] }>(
`/review/${token}/submissions`,
);
};
export const getReviewSubmission = async (token: string, reviewId: string) => {
return await apiFetch<Review>(`/review/${token}/submissions/${reviewId}`);
};
export const postReviewEvaluation = async (
token: string,
reviewId: string,
evaluation: ReviewEvaluation[],
) => {
return await apiFetch(`/review/${token}/submissions/${reviewId}/evaluate`, {
method: "POST",
body: {
evaluation,
},
});
};