mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 09:47:09 +00:00
feat: review
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { apiFetch } from ".";
|
||||
import { Reviewer } from "../types/review";
|
||||
import { Review, Reviewer } from "../types/review";
|
||||
|
||||
export const getReviewer = async (token: string) => {
|
||||
return await apiFetch<Reviewer>(`/review/${token}`);
|
||||
};
|
||||
|
||||
export const getReviewerSubmissions = async (token: string) => {
|
||||
return await apiFetch(`/review/${token}/submissions`);
|
||||
return await apiFetch<{ submissions: Review[] }>(
|
||||
`/review/${token}/submissions`,
|
||||
);
|
||||
};
|
||||
|
||||
@@ -3,3 +3,38 @@ export interface Reviewer {
|
||||
name: string;
|
||||
surname: string;
|
||||
}
|
||||
|
||||
export interface Review {
|
||||
id: string;
|
||||
review_status: ReviewStatus;
|
||||
evaluation?: ReviewEvaluation[];
|
||||
criteries?: ReviewCriteria[];
|
||||
submitted_at: Date;
|
||||
competition: string;
|
||||
competition_name: string;
|
||||
task: string;
|
||||
content: string;
|
||||
stdout?: string;
|
||||
result?: {};
|
||||
earned_points?: number;
|
||||
checked_at?: Date;
|
||||
task_title: string;
|
||||
}
|
||||
|
||||
export enum ReviewStatus {
|
||||
NOT_CHECKED = "not_checked",
|
||||
CHECKED = "checked",
|
||||
CHECKING = "checking",
|
||||
}
|
||||
|
||||
export interface ReviewEvaluation {
|
||||
slug: string;
|
||||
mark: number;
|
||||
}
|
||||
|
||||
export interface ReviewCriteria {
|
||||
name: string;
|
||||
slug: string;
|
||||
max_value: number;
|
||||
min_value: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user