diff --git a/src/guests/components/Guest.js b/src/guests/components/Guest.js index 4c8ec8f1..4df4a3dd 100644 --- a/src/guests/components/Guest.js +++ b/src/guests/components/Guest.js @@ -12,6 +12,7 @@ import TicketsList from 'components/TicketsList'; const Guest = ({ id }) => { const [guest, setGuest] = useState(), [event, setEvent] = useState(), + [users, setUsers] = useState(), [editingComment, setEditingComment] = useState(''), [commentInput, setCommentInput] = useState(''); @@ -23,6 +24,12 @@ const Guest = ({ id }) => { .catch(e => console.error('Guest API Error', e)); }, [id]); + useEffect(() => { + apiClient.get('/users') + .then(setUsers) + .catch(e => console.error('Users API Error', e)); + }, []); + useEffect(() => { if(!guest) return; @@ -59,6 +66,16 @@ const Guest = ({ id }) => { { name: eventName } = event, { role } = user; + let createdByName = ''; + if (createdBy) { + createdByName = users.find(u => u.id === createdBy)?.displayName; + } + + let updatedByName = ''; + if (updatedBy) { + updatedByName = users.find(u => u.id === updatedBy)?.displayName; + } + return (
✅
} + {guest.admissionTier === 'vip' + ? checkScope(role, 'write') + ? + :✅
+ : checkScope(role, 'write') + ? + : '' + }{event.name}
{product?.name}
+{product?.name}