test(app): catalogue card integrity and retry on the sandbox
This commit is contained in:
1 parent
6ad8d8347c
commit
dadd8e5d29
3 files changed
+357
-8
No files matched your search
@@ -34,14 +34,14 @@ export async function assignRole(
|
||||
)
|
||||
}
|
||||
|
||||
/** A right granted earlier by the owner (a prior action, written as postgres). */
|
||||
/** A right granted earlier by the owner (a prior action, written as postgres); resolves with its id. */
|
||||
export async function seedGrant(
|
||||
account: SandboxAccount,
|
||||
kind: GrantKind,
|
||||
): Promise<void> {
|
||||
): Promise<string> {
|
||||
const note = kind === 'catalog_reader' ? 'null' : "'sandbox'"
|
||||
await sql(`insert into public.anatomical_catalog_grants (user_id, grant_kind, reason, verification_note, granted_by)
|
||||
values ('${account.id}', '${kind}', 'sandbox', ${note}, '${account.id}')`)
|
||||
return sql(`insert into public.anatomical_catalog_grants (user_id, grant_kind, reason, verification_note, granted_by)
|
||||
values ('${account.id}', '${kind}', 'sandbox', ${note}, '${account.id}') returning id`)
|
||||
}
|
||||
|
||||
/** A password session of the account on GoTrue: always aal1. */
|
||||
|
||||
Reference in new issue
Block a user