spine-framework 0.3.44 → 0.3.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -478,11 +478,14 @@ async function resolveHumanPrincipal(token: string, event: any): Promise<Princip
|
|
|
478
478
|
// Load person details
|
|
479
479
|
const { data: person, error: personError } = await adminDb
|
|
480
480
|
.from('people')
|
|
481
|
-
.select('*, role:role_id(slug, name, is_system, is_protected)')
|
|
481
|
+
.select('*, role:roles!role_id(slug, name, is_system, is_protected)')
|
|
482
482
|
.eq('id', personId)
|
|
483
|
-
.
|
|
483
|
+
.maybeSingle()
|
|
484
484
|
|
|
485
|
-
if (personError
|
|
485
|
+
if (personError) {
|
|
486
|
+
throw new Error('Person lookup error: ' + personError.message + ' (id: ' + personId + ')')
|
|
487
|
+
}
|
|
488
|
+
if (!person) {
|
|
486
489
|
throw new Error('Person not found: ' + personId)
|
|
487
490
|
}
|
|
488
491
|
|