MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / assertUserExists

Function assertUserExists

utils/progresses.js:54–59  ·  view source on GitHub ↗
(userId)

Source from the content-addressed store, hash-verified

52 * @returns {Promise<void>} A promise that resolves if the user exists and rejects with a `NotFound` error if the user does not exist.
53 */
54const assertUserExists = async (userId) => {
55 const { userExists } = await fetchUser({ userId });
56 if (!userExists) {
57 throw new NotFound(`User with id ${userId} does not exist.`);
58 }
59};
60
61/**
62 * Checks if a user with a given ID exists in the system.

Callers 1

assertUserOrTaskExistsFunction · 0.85

Calls 1

fetchUserFunction · 0.85

Tested by

no test coverage detected