mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 14:27:10 +00:00
feat: review
This commit is contained in:
@@ -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",
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user