fix(portal) : handle submittedBy as object or IRI in canEdit check
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -239,9 +239,12 @@ const canEdit = computed(() => {
|
||||
if (status === 'done' || status === 'rejected') return false
|
||||
const userId = auth.user?.id
|
||||
if (!userId) return false
|
||||
const submittedByIri = props.ticket.submittedBy
|
||||
if (!submittedByIri) return false
|
||||
return submittedByIri === `/api/users/${userId}`
|
||||
const sub = props.ticket.submittedBy
|
||||
if (!sub) return false
|
||||
// submittedBy can be an IRI string or an embedded object
|
||||
if (typeof sub === 'string') return sub === `/api/users/${userId}`
|
||||
if (typeof sub === 'object' && 'id' in sub) return (sub as any).id === userId
|
||||
return false
|
||||
})
|
||||
|
||||
function startEdit() {
|
||||
|
||||
Reference in New Issue
Block a user