AP0.7: Tenant Hardening, Actor Directory und Data Layer Minimum
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
36487d2869
commit
db06af0489
32 files changed
+1424
-43
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { listActors, actorsFromContext } from '../api/actors.js'
|
||||
import { useSession } from '../context/SessionContext.jsx'
|
||||
|
||||
/**
|
||||
* Lädt Tenant-Actor-Directory; Fallback auf Human Actor aus Context.
|
||||
*/
|
||||
export function useActors() {
|
||||
const { context } = useSession()
|
||||
const [actors, setActors] = useState([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
const [usedFallback, setUsedFallback] = useState(false)
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
setUsedFallback(false)
|
||||
try {
|
||||
const data = await listActors()
|
||||
setActors(data)
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
const fallback = actorsFromContext(context)
|
||||
setActors(fallback)
|
||||
setUsedFallback(fallback.length > 0)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [context])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
return { actors, loading, error, usedFallback, reload: load }
|
||||
}
|
||||
Reference in new issue
Block a user