Skip to content

Commit aaeca15

Browse files
committed
fix(firebase): generate update on display name change
1 parent fb16b2e commit aaeca15

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

firebase/functions/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ exports.usernameUpdate = functions.database.ref('/v2/users/{userId}/username/').
288288
return admin.database().ref('/v2/updates/users/').child(userId).set(true);
289289
});
290290

291+
// Generate updates when display name is changed
292+
exports.displayNameUpdate = functions.database.ref('/v2/users/{userId}/displayName/').onWrite((_, context) => {
293+
const userId = context.params.userId;
294+
return admin.database().ref('/v2/updates/users/').child(userId).set(true);
295+
});
296+
291297

292298
/*
293299
* Generates update commands for PSQL db

0 commit comments

Comments
 (0)