Skip to content

Commit 9154a33

Browse files
committed
Switch to org ids array
1 parent 6acba0e commit 9154a33

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

site/src/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface UserResponse {
2323
readonly email: string
2424
readonly created_at: string
2525
readonly status: "active" | "suspended"
26-
readonly organization_id: string
26+
readonly organization_ids: string[]
2727
}
2828

2929
/**

site/src/pages/PreferencesPages/AccountPage/AccountPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("AccountPage", () => {
3636
id: userId,
3737
created_at: new Date().toString(),
3838
status: "active",
39-
organization_id: "123",
39+
organization_ids: ["123"],
4040
...data,
4141
}),
4242
)

site/src/testHelpers/entities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const MockUser: UserResponse = {
2626
email: "test@coder.com",
2727
created_at: "",
2828
status: "active",
29-
organization_id: "123",
29+
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
3030
}
3131

3232
export const MockUser2: UserResponse = {
@@ -35,7 +35,7 @@ export const MockUser2: UserResponse = {
3535
email: "test2@coder.com",
3636
created_at: "",
3737
status: "active",
38-
organization_id: "123",
38+
organization_ids: ["fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0"],
3939
}
4040

4141
export const MockPager: Pager = {

site/src/xServices/auth/authSelectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { State } from "xstate"
22
import { AuthContext, AuthEvent } from "./authXService"
33

44
export const selectOrgId = (state: State<AuthContext, AuthEvent>): string | undefined => {
5-
return state.context.me?.organization_id
5+
return state.context.me?.organization_ids[0]
66
}

0 commit comments

Comments
 (0)