(userId)
| 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 | */ |
| 54 | const 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. |
no test coverage detected