Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/fetchers/user-fetchers.js
Show All 18 Lines | import type { | ||||
GlobalUserInfo, | GlobalUserInfo, | ||||
} from 'lib/types/user-types'; | } from 'lib/types/user-types'; | ||||
import { ServerError } from 'lib/utils/errors'; | import { ServerError } from 'lib/utils/errors'; | ||||
import { dbQuery, SQL } from '../database/database'; | import { dbQuery, SQL } from '../database/database'; | ||||
import type { Viewer } from '../session/viewer'; | import type { Viewer } from '../session/viewer'; | ||||
async function fetchUserInfos( | async function fetchUserInfos( | ||||
userIDs: string[], | userIDs: $ReadOnlyArray<string>, | ||||
): Promise<{ [id: string]: GlobalUserInfo }> { | ): Promise<{ [id: string]: GlobalUserInfo }> { | ||||
if (userIDs.length <= 0) { | if (userIDs.length <= 0) { | ||||
return {}; | return {}; | ||||
} | } | ||||
const query = SQL` | const query = SQL` | ||||
SELECT id, username FROM users WHERE id IN (${userIDs}) | SELECT id, username FROM users WHERE id IN (${userIDs}) | ||||
`; | `; | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |