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
|
if (status === 'done' || status === 'rejected') return false
|
||||||
const userId = auth.user?.id
|
const userId = auth.user?.id
|
||||||
if (!userId) return false
|
if (!userId) return false
|
||||||
const submittedByIri = props.ticket.submittedBy
|
const sub = props.ticket.submittedBy
|
||||||
if (!submittedByIri) return false
|
if (!sub) return false
|
||||||
return submittedByIri === `/api/users/${userId}`
|
// 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() {
|
function startEdit() {
|
||||||
|
|||||||
Reference in New Issue
Block a user