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

This commit is contained in:
shamoon
2024-02-13 09:25:35 -08:00
committed by GitHub
parent 907b6d1294
commit d83bbdc50b
4 changed files with 41 additions and 14 deletions

View File

@@ -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)