fix: type

This commit is contained in:
Myzel394 2023-03-11 15:12:14 +01:00
parent 92570d4e71
commit 0ab708e519
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B

View File

@ -1,7 +1,7 @@
import {ReactElement, useLayoutEffect, useState} from "react" import {ReactElement, useLayoutEffect, useState} from "react"
import {useTranslation} from "react-i18next" import {useTranslation} from "react-i18next"
import {useQuery} from "@tanstack/react-query" import {useQuery} from "@tanstack/react-query"
import {APIKey, PaginationResult} from "~/server-types" import {APIKey, APIKeyScope, PaginationResult} from "~/server-types"
import {AxiosError} from "axios" import {AxiosError} from "axios"
import {getAPIKeys} from "~/apis" import {getAPIKeys} from "~/apis"
import {QueryResult, SimplePage} from "~/components" import {QueryResult, SimplePage} from "~/components"
@ -23,7 +23,9 @@ export default function SettingsAPIKeysRoute(): ReactElement {
const params = { const params = {
action: rawParams.action === "create-new" ? "create-new" : undefined, action: rawParams.action === "create-new" ? "create-new" : undefined,
scopes: isArray(rawParams.scopes?.split(",")) scopes: isArray(rawParams.scopes?.split(","))
? rawParams.scopes.split(",").filter((scope: string) => API_KEY_SCOPES.includes(scope)) ? rawParams.scopes
.split(",")
.filter((scope: APIKeyScope) => API_KEY_SCOPES.includes(scope))
: [], : [],
label: rawParams.label, label: rawParams.label,
} }