add report submission
This commit is contained in:
@@ -123,6 +123,7 @@ function ActionMenu({ row }: { row: any }) {
|
||||
<CancelItem
|
||||
id={row.id}
|
||||
cancelPolicy={data?.cancel_policy}
|
||||
lock={data?.lock}
|
||||
onSuccess={onSuccess}
|
||||
/>
|
||||
</>
|
||||
@@ -180,7 +181,7 @@ function RemoveDedupItem({
|
||||
const [loading, { set }] = useToggle(false)
|
||||
const [open, { set: setOpen }] = useToggle(false)
|
||||
|
||||
const cancel = async (e: MouseEvent<HTMLButtonElement>) => {
|
||||
const remove = async (e: MouseEvent<HTMLButtonElement>) => {
|
||||
e.preventDefault()
|
||||
set(true)
|
||||
|
||||
@@ -231,7 +232,7 @@ function RemoveDedupItem({
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter className="*:cursor-pointer">
|
||||
<AlertDialogAction asChild>
|
||||
<Button onClick={cancel} disabled={loading} variant="destructive">
|
||||
<Button onClick={remove} disabled={loading} variant="destructive">
|
||||
{loading ? <Spinner /> : null} Continuar
|
||||
</Button>
|
||||
</AlertDialogAction>
|
||||
@@ -272,8 +273,9 @@ function CancelItem({
|
||||
set(true)
|
||||
|
||||
const r = await fetch(`/~/api/enrollments/${id}/cancel`, {
|
||||
method: 'POST',
|
||||
headers: new Headers({ 'Content-Type': 'application/json' })
|
||||
method: 'PATCH',
|
||||
headers: new Headers({ 'Content-Type': 'application/json' }),
|
||||
body: JSON.stringify({ lock_hash: lock?.hash })
|
||||
})
|
||||
|
||||
if (r.ok) {
|
||||
|
||||
Reference in New Issue
Block a user