diff --git a/web/src/app/submissions/[submissionId]/_reviewButtons.tsx b/web/src/app/submissions/[submissionId]/_reviewButtons.tsx index 9f226f8..f5a3a14 100644 --- a/web/src/app/submissions/[submissionId]/_reviewButtons.tsx +++ b/web/src/app/submissions/[submissionId]/_reviewButtons.tsx @@ -1,8 +1,10 @@ import { Button, ButtonOwnProps } from "@mui/material"; type Review = "Completed" | "Submit" | "Reject" | "Revoke" | "Validate" | "Publish" +type Action = "completed" | "submit" | "reject" | "revoke" | "trigger-validate" | "trigger-publish" interface ReviewButton { name: Review, + action: Action, color: ButtonOwnProps["color"] } @@ -25,8 +27,8 @@ interface ReviewButton { // -X POST \ // localhost:8081/v1/submissions/1/status/submit -function ReviewButtonClicked(type: Review) { - const post = fetch(`http://localhost:8081/v1/submissions/1/status/${type.toLowerCase()}`, { +function ReviewButtonClicked(action: Action) { + const post = fetch(`http://localhost:8081/v1/submissions/1/status/${action}`, { method: "POST", headers: { "Content-type": "application/json", @@ -36,18 +38,18 @@ function ReviewButtonClicked(type: Review) { } function ReviewButton(props: ReviewButton) { - return + return } export default function ReviewButtons() { return (
- - - - - - + + + + + +
) -} \ No newline at end of file +}