Skip to content

Commit

Permalink
fix: Add company_name prop to workpace resource (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi authored Jun 13, 2024
1 parent 23549f4 commit c991dd2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/database/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export interface DatabaseMethods {
workspace_id?: string
is_sandbox?: boolean
connect_partner_name?: string
company_name?: string
}) => Workspace
resetSandboxWorkspace: (workspace_id: string) => void
addApiKey: (params: {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/database/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ const initializer = immer<Database>((set, get) => ({
created_at: params.created_at ?? new Date().toISOString(),
is_sandbox: params.is_sandbox ?? false,
connect_partner_name: params.connect_partner_name ?? null,
company_name:
params.company_name ??
params.connect_partner_name ??
"Fake Company Name",
}
set({
workspaces: [...get().workspaces, new_workspace],
Expand Down
6 changes: 5 additions & 1 deletion src/lib/zod/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export const workspace = z.object({
publishable_key: z.string(),
created_at: z.string(),
is_sandbox: z.boolean(),
connect_partner_name: z.string().nullable(),
company_name: z.string(),
connect_partner_name: z
.string()
.nullable()
.describe("deprecated: use company_name"),
})

export type Workspace = z.infer<typeof workspace>
8 changes: 8 additions & 0 deletions src/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3058,6 +3058,8 @@ export type Routes = {
publishable_key: string
created_at: string
is_sandbox: boolean
company_name: string
/** deprecated: use company_name */
connect_partner_name: string | null
}
ok: boolean
Expand Down Expand Up @@ -5066,6 +5068,8 @@ export type Routes = {
publishable_key: string
created_at: string
is_sandbox: boolean
company_name: string
/** deprecated: use company_name */
connect_partner_name: string | null
}
ok: boolean
Expand All @@ -5085,6 +5089,8 @@ export type Routes = {
publishable_key: string
created_at: string
is_sandbox: boolean
company_name: string
/** deprecated: use company_name */
connect_partner_name: string | null
}
ok: boolean
Expand All @@ -5104,6 +5110,8 @@ export type Routes = {
publishable_key: string
created_at: string
is_sandbox: boolean
company_name: string
/** deprecated: use company_name */
connect_partner_name: string | null
}[]
ok: boolean
Expand Down
1 change: 1 addition & 0 deletions test/api/workspaces/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ test("GET /workspaces/get", async (t: ExecutionContext) => {
})

t.truthy(workspace)
t.truthy(workspace.company_name)
t.is(workspace.workspace_id, seed.ws2.workspace_id)
})

0 comments on commit c991dd2

Please sign in to comment.