Skip to content

Commit

Permalink
Fix where equality operator
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed May 8, 2024
1 parent 99c6bb7 commit 830b459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('Returns result of fetchGlobalAccessForQuery with roles query + cache key',

const res = await fetchGlobalAccessForUser(knex, 'user-a');

expect(knex.where).toHaveBeenCalledWith('user', 'eq', 'user-a');
expect(knex.where).toHaveBeenCalledWith('user', '=', 'user-a');
expect(fetchGlobalAccessForQuery).toHaveBeenCalledWith(mockKnex, 'global-access-user-user-a');
expect(res).toBe(mockResult);
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import type { GlobalAccess } from '../types.js';
import { fetchGlobalAccessForQuery } from '../utils/fetch-global-access-for-query.js';

export async function fetchGlobalAccessForUser(knex: Knex, user: string): Promise<GlobalAccess> {
const query = knex.where('user', 'eq', user);
const query = knex.where('user', '=', user);
return await fetchGlobalAccessForQuery(query, `global-access-user-${user}`);
}

0 comments on commit 830b459

Please sign in to comment.