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

@ -6,9 +6,8 @@ const nextConfig = {
experimental: { experimental: {
// esmExternals: true, // esmExternals: true,
appDir: true, appDir: true,
serverComponentsExternalPackages: ["prisma", "@prisma/client"] serverComponentsExternalPackages: ["prisma", "@prisma/client"],
}, },
output: "standalone",
rewrites() { rewrites() {
return [ return [
{ {
@ -27,9 +26,6 @@ const nextConfig = {
env: { env: {
NEXT_PUBLIC_DRIFT_URL: process.env.DRIFT_URL NEXT_PUBLIC_DRIFT_URL: process.env.DRIFT_URL
}, },
typescript: {
// ignoreBuildErrors: true,
}
} }
export default bundleAnalyzer({ enabled: process.env.ANALYZE === "true" })( export default bundleAnalyzer({ enabled: process.env.ANALYZE === "true" })(

View file

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