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

Function updateProfileDiff

models/profileDiffs.js:184–200  ·  view source on GitHub ↗
(profileDiffData, profileId)

Source from the content-addressed store, hash-verified

182 */
183
184const updateProfileDiff = async (profileDiffData, profileId) => {
185 try {
186 const profileDiff = await profileDiffsModel.doc(profileId).get();
187 const data = profileDiff.data();
188 if (!data) return { notFound: true };
189
190 await profileDiffsModel.doc(profileId).set({
191 ...data,
192 ...profileDiffData,
193 });
194
195 return { id: profileDiff.id, userId: data.userId };
196 } catch (err) {
197 logger.error("Error in updating profile diff", err);
198 throw err;
199 }
200};
201
202module.exports = {
203 fetchProfileDiffs,

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected