Keep nonbanking panel routes available with minimal adapters
This commit is contained in:
parent
ca6465836a
commit
31fa039e4f
1 changed files with 3 additions and 0 deletions
|
|
@ -37,6 +37,9 @@ async function officeAuthority(tx,d,actor,now,lock=false){
|
|||
return holder;
|
||||
}
|
||||
export function createPoliticalDecisions(db,bank,keys,deps={}){
|
||||
// Unrelated panel routes also run with a read-only/minimal store. They must
|
||||
// remain usable; only this decision service requires transactional banking.
|
||||
if(typeof db?.query!=='function'||typeof db?.transaction!=='function')return{read:async()=>fail('Decision banking unavailable.',503),execute:async()=>fail('Decision banking unavailable.',503)};
|
||||
// The production central pool exposes prepared reads rather than first().
|
||||
// Keep every transaction callback on its original connection.
|
||||
db={...boardReadStore(db,db),transaction:db.transaction.bind(db)};
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff