@@ -3,8 +3,8 @@ import { parse } from "@conform-to/zod";
33import { BookOpenIcon , ShieldCheckIcon , TrashIcon } from "@heroicons/react/20/solid" ;
44import { ShieldExclamationIcon } from "@heroicons/react/24/solid" ;
55import { DialogClose } from "@radix-ui/react-dialog" ;
6- import { Form , MetaFunction , useActionData , useFetcher } from "@remix-run/react" ;
7- import { ActionFunction , LoaderFunctionArgs , json } from "@remix-run/server-runtime" ;
6+ import { Form , type MetaFunction , useActionData , useFetcher } from "@remix-run/react" ;
7+ import { type ActionFunction , type LoaderFunctionArgs , json } from "@remix-run/server-runtime" ;
88import { typedjson , useTypedLoaderData } from "remix-typedjson" ;
99import { z } from "zod" ;
1010import { PageBody , PageContainer } from "~/components/layout/AppLayout" ;
@@ -16,7 +16,6 @@ import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "~/components
1616import { Fieldset } from "~/components/primitives/Fieldset" ;
1717import { FormButtons } from "~/components/primitives/FormButtons" ;
1818import { FormError } from "~/components/primitives/FormError" ;
19- import { Header2 } from "~/components/primitives/Headers" ;
2019import { Hint } from "~/components/primitives/Hint" ;
2120import { Input } from "~/components/primitives/Input" ;
2221import { InputGroup } from "~/components/primitives/InputGroup" ;
@@ -36,8 +35,8 @@ import {
3635import { SimpleTooltip } from "~/components/primitives/Tooltip" ;
3736import { redirectWithSuccessMessage } from "~/models/message.server" ;
3837import {
39- CreatedPersonalAccessToken ,
40- ObfuscatedPersonalAccessToken ,
38+ type CreatedPersonalAccessToken ,
39+ type ObfuscatedPersonalAccessToken ,
4140 createPersonalAccessToken ,
4241 getValidPersonalAccessTokens ,
4342 revokePersonalAccessToken ,
@@ -53,7 +52,7 @@ export const meta: MetaFunction = () => {
5352 ] ;
5453} ;
5554
56- export const loader = async ( { request, params } : LoaderFunctionArgs ) => {
55+ export const loader = async ( { request } : LoaderFunctionArgs ) => {
5756 const userId = await requireUserId ( request ) ;
5857
5958 try {
@@ -113,7 +112,7 @@ export const action: ActionFunction = async ({ request }) => {
113112 }
114113 case "revoke" : {
115114 try {
116- await revokePersonalAccessToken ( submission . value . tokenId ) ;
115+ await revokePersonalAccessToken ( submission . value . tokenId , userId ) ;
117116
118117 return redirectWithSuccessMessage (
119118 personalAccessTokensPath ( ) ,
@@ -125,6 +124,7 @@ export const action: ActionFunction = async ({ request }) => {
125124 }
126125 }
127126 default : {
127+ submission . value satisfies never ;
128128 return json ( { errors : { body : "Invalid action" } } , { status : 400 } ) ;
129129 }
130130 }
0 commit comments