web: fix api types
This commit is contained in:
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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user