fix: eslint
This commit is contained in:
parent
c37f8f77c2
commit
46567538dc
6 changed files with 6 additions and 9 deletions
|
|
@ -15,6 +15,6 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
ignores: ["eslint.config.js", "prettier.config.js"],
|
||||
ignores: ["eslint.config.js", "prettier.config.js", ".output/**"],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ function GlobalNav({ pathname }: { pathname: string }) {
|
|||
const isActive =
|
||||
to === "/apps"
|
||||
? pathname === "/apps" || pathname === "/apps/"
|
||||
: to === "/sessions"
|
||||
? pathname.startsWith("/sessions")
|
||||
: pathname === to;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export async function authenticateApiKey(
|
|||
});
|
||||
|
||||
for (const candidate of candidates) {
|
||||
if (candidate.app?.deletedAt) continue;
|
||||
if (candidate.app.deletedAt) continue;
|
||||
const valid = await verifyApiKey(key, candidate.keyHash);
|
||||
if (valid) return { appId: candidate.appId, keyId: candidate.id };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ export async function usePostgresAuthState(
|
|||
|
||||
async set(data: SignalDataSet) {
|
||||
for (const [type, typeData] of Object.entries(data)) {
|
||||
if (!typeData) continue;
|
||||
for (const [id, value] of Object.entries(typeData)) {
|
||||
if (value == null) {
|
||||
await db
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const Route = createFileRoute("/api/v1/admin/apps/")({
|
|||
const session = await readSession(request);
|
||||
if (!session?.userId) return jsonError("Unauthorized", 401);
|
||||
|
||||
let body: { name: string; maxSessions?: number };
|
||||
let body: { name?: string; maxSessions?: number };
|
||||
try {
|
||||
body = await request.json();
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ async function api(
|
|||
opts: { apiKey?: string; body?: unknown } = {},
|
||||
): Promise<ApiResult> {
|
||||
return page.evaluate(
|
||||
async ({ method, url, apiKey, body }) => {
|
||||
async ({ method: httpMethod, url, apiKey, body }) => {
|
||||
const headers: Record<string, string> = {};
|
||||
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
||||
if (body !== undefined) headers["Content-Type"] = "application/json";
|
||||
const res = await fetch(url, {
|
||||
method,
|
||||
method: httpMethod,
|
||||
headers,
|
||||
body: body !== undefined ? JSON.stringify(body) : undefined,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue