web: fix api types

This commit is contained in:
rhpidfyre 2025-03-28 18:26:59 -04:00
parent f0e18a5963
commit a7784bdaf5

@ -1,12 +1,12 @@
import { Button, ButtonOwnProps } from "@mui/material";
type Actions = "Completed" | "Submit" | "Reject" | "Revoke" | "Reset Uploading (fix softlocked status)" | "Reset Validating (fix softlocked status)"
type Review = Actions | "Accept" | "Validate" | "Upload"
type Action = Lowercase<Actions> | "trigger-validate" | "retry-validate" | "trigger-upload" | "reset-uploading" | "reset-validating"
type Actions = "Completed" | "Submit" | "Reject" | "Revoke"
type ApiActions = Lowercase<Actions> | "trigger-validate" | "retry-validate" | "trigger-upload" | "reset-uploading" | "reset-validating"
type Review = Actions | "Accept" | "Validate" | "Upload" | "Reset Uploading (fix softlocked status)" | "Reset Validating (fix softlocked status)" | "Request Changes"
interface ReviewButton {
name: Review,
action: Action,
action: ApiActions,
submissionId: string,
color: ButtonOwnProps["color"]
}
@ -15,7 +15,7 @@ interface ReviewId {
submissionId: string
}
async function ReviewButtonClicked(action: Action, submissionId: string) {
async function ReviewButtonClicked(action: ApiActions, submissionId: string) {
try {
const response = await fetch(`/api/submissions/${submissionId}/status/${action}`, {
method: "POST",