Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Dec 27, 2024
1 parent 40a6609 commit b06fabf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/backend/src/app/api/v1/users/crud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ export function getUserQuery(projectId: string, userId: string): RawQuery<UsersC
) AS "row_data_json"
`,
postProcess: (queryResult) => {
if (queryResult.length === 0) {
return null;
}
if (queryResult.length !== 1) {
throw new StackAssertionError("Expected 1 result, got " + queryResult.length, queryResult);
}

const row = queryResult[0].row_data_json;
if (!row) {
return null;
}

const primaryEmailContactChannel = row.ContactChannels.find((c: any) => c.type === 'EMAIL' && c.isPrimary);
const passwordAuth = row.AuthMethods.find((m: any) => m.PasswordAuthMethod);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ it("should return metrics data with users", async ({ expect }) => {

const response = await niceBackendFetch("/api/v1/internal/metrics", { accessType: 'admin' });
expect(response).toMatchSnapshot();
}, {
timeout: 60_000,
});

it("should not work for non-admins", async ({ expect }) => {
Expand Down

0 comments on commit b06fabf

Please sign in to comment.