@@ -3,8 +3,8 @@ import { parse } from "@conform-to/zod";
3
3
import { BookOpenIcon , ShieldCheckIcon , TrashIcon } from "@heroicons/react/20/solid" ;
4
4
import { ShieldExclamationIcon } from "@heroicons/react/24/solid" ;
5
5
import { 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" ;
8
8
import { typedjson , useTypedLoaderData } from "remix-typedjson" ;
9
9
import { z } from "zod" ;
10
10
import { PageBody , PageContainer } from "~/components/layout/AppLayout" ;
@@ -16,7 +16,6 @@ import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "~/components
16
16
import { Fieldset } from "~/components/primitives/Fieldset" ;
17
17
import { FormButtons } from "~/components/primitives/FormButtons" ;
18
18
import { FormError } from "~/components/primitives/FormError" ;
19
- import { Header2 } from "~/components/primitives/Headers" ;
20
19
import { Hint } from "~/components/primitives/Hint" ;
21
20
import { Input } from "~/components/primitives/Input" ;
22
21
import { InputGroup } from "~/components/primitives/InputGroup" ;
@@ -36,8 +35,8 @@ import {
36
35
import { SimpleTooltip } from "~/components/primitives/Tooltip" ;
37
36
import { redirectWithSuccessMessage } from "~/models/message.server" ;
38
37
import {
39
- CreatedPersonalAccessToken ,
40
- ObfuscatedPersonalAccessToken ,
38
+ type CreatedPersonalAccessToken ,
39
+ type ObfuscatedPersonalAccessToken ,
41
40
createPersonalAccessToken ,
42
41
getValidPersonalAccessTokens ,
43
42
revokePersonalAccessToken ,
@@ -53,7 +52,7 @@ export const meta: MetaFunction = () => {
53
52
] ;
54
53
} ;
55
54
56
- export const loader = async ( { request, params } : LoaderFunctionArgs ) => {
55
+ export const loader = async ( { request } : LoaderFunctionArgs ) => {
57
56
const userId = await requireUserId ( request ) ;
58
57
59
58
try {
@@ -113,7 +112,7 @@ export const action: ActionFunction = async ({ request }) => {
113
112
}
114
113
case "revoke" : {
115
114
try {
116
- await revokePersonalAccessToken ( submission . value . tokenId ) ;
115
+ await revokePersonalAccessToken ( submission . value . tokenId , userId ) ;
117
116
118
117
return redirectWithSuccessMessage (
119
118
personalAccessTokensPath ( ) ,
@@ -125,6 +124,7 @@ export const action: ActionFunction = async ({ request }) => {
125
124
}
126
125
}
127
126
default : {
127
+ submission . value satisfies never ;
128
128
return json ( { errors : { body : "Invalid action" } } , { status : 400 } ) ;
129
129
}
130
130
}
0 commit comments