Fix: handle document notes user format api change (#5751)

This commit is contained in:
shamoon authored and GitHub committed 2024-02-13 17:25:35 +00:00
1 parent 907b6d1294
commit d83bbdc50b
4 files changed
+41 -14

No files matched your search

@@ -84,7 +84,8 @@ export class DocumentNotesComponent extends ComponentWithPermissions {
displayName(note: DocumentNote): string {
if (!note.user) return ''
const user = this.users?.find((u) => u.id === note.user)
const user_id = typeof note.user === 'number' ? note.user : note.user.id
const user = this.users?.find((u) => u.id === user_id)
if (!user) return ''
const nameComponents = []
if (user.first_name) nameComponents.push(user.first_name)