| 542 | await documentRef.update(unverifiedUserData); |
| 543 | } else await photoVerificationModel.add(unverifiedUserData); |
| 544 | } catch (err) { |
| 545 | logger.error("Error in creating Verification Entry", err); |
| 546 | throw err; |
| 547 | } |
| 548 | return { message: "Profile data added for verification successfully" }; |
| 549 | }; |
| 550 | |
| 551 | /** |
| 552 | * Removes if user passed a valid image; ignores if no unverified record |
| 553 | * @param userId {String} - RDS user Id |
| 554 | * @param type {String} - type of image that was verified |
| 555 | * @return {Promise<{message: string}|{message: string}>} |
| 556 | * @throws {Error} - If error occurs while verifying user's image |
| 557 | */ |
| 558 | const markAsVerified = async (userId, imageType) => { |