History

Fix web app TypeScript errors in approvals views and auth provider

- database.ts: Use TaskStatus type instead of string for task.status in listPendingApprovals return type so it matches PendingApprovalRecord - convex-provider.tsx: Coerce undefined to null in getAccessToken return to match Convex UseAuth interface

Rhys Sullivan committed 9 months ago

Commit bfdfd721 parent fc207af2 files · +3 −2Browse files

Unified · Split

2 files
  1. executor/apps/web/src/lib/convex-provider.tsx +1 −1
  2. executor/convex/database.ts +2 −1
executor/apps/web/src/lib/convex-provider.tsx+1−1
@@ -21,7 +21,7 @@ function useConvexWorkosAuth() { · 20 unmodified lines
2121 return {
2222 isLoading: loading,
2323 user,
24− getAccessToken,
24+ getAccessToken: async () => (await getAccessToken()) ?? null,
2525 };
2626 }
2727
executor/convex/database.ts+2−1
@@ -3,6 +3,7 @@ import type { Doc } from "./_generated/dataModel"; · 2 unmodified lines
33 import type { MutationCtx, QueryCtx } from "./_generated/server";
44 import { mutation, query } from "./_generated/server";
55 import { ensureUniqueSlug } from "./lib/slug";
6+import type { TaskStatus } from "@executor/contracts";
67
78 const DEFAULT_TIMEOUT_MS = 300_000;
89 type OrganizationRole = "owner" | "admin" | "member" | "billing_admin";
@@ -558,7 +559,7 @@ export const listPendingApprovals = query({ · 549 unmodified lines
558559
559560 const results: Array<
560561 ReturnType<typeof mapApproval> & {
561− task: { id: string; status: string; runtimeId: string; timeoutMs: number; createdAt: number };
562+ task: { id: string; status: TaskStatus; runtimeId: string; timeoutMs: number; createdAt: number };
562563 }
563564 > = [];
564565 for (let i = 0; i < docs.length; i++) {