Add toast for revoked api key

This commit is contained in:
Max Leiter 2023-02-23 23:45:26 -08:00
parent d1e5dca3d0
commit 0b6d31373d
2 changed files with 10 additions and 6 deletions

View file

@ -56,6 +56,14 @@ const APIKeys = ({
setSubmitting(false)
}
}
const onRevoke = (tokenId: string) => {
expireToken(tokenId)
setToast({
message: "Your API key has been revoked.",
type: "success"
})
}
const hasError = Boolean(error)
return (
@ -106,7 +114,7 @@ const APIKeys = ({
<td>
<Button
type="button"
onClick={() => expireToken(token.id)}
onClick={() => onRevoke(token.id)}
>
Revoke
</Button>