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

Function fetchUserImage

models/users.js:581–588  ·  view source on GitHub ↗
(users)

Source from the content-addressed store, hash-verified

579 * @return {Promise<{Object}|{Object}>}
580 * @throws {Error} - If error occurs while fetching user's image verification entry
581 */
582const getUserImageForVerification = async (userId) => {
583 try {
584 const verificationImagesSnapshot = await photoVerificationModel.where("userId", "==", userId).get();
585 if (verificationImagesSnapshot.empty) {
586 throw new Error(`No document with userId: ${userId} was found!`);
587 }
588 return verificationImagesSnapshot.docs[0].data();
589 } catch (err) {
590 logger.error("Error while Removing Verification Entry", err);
591 throw err;

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected