mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
Scope plugin config bridge reads to invocation company
This commit is contained in:
parent
1580e3b755
commit
8969a713a1
2 changed files with 52 additions and 2 deletions
|
|
@ -627,8 +627,16 @@ export function createHostClientHandlers(
|
|||
|
||||
return {
|
||||
// Config
|
||||
"config.get": gated("config.get", async (params) => {
|
||||
return services.config.get(params);
|
||||
"config.get": gated("config.get", async (params, context) => {
|
||||
const scopedCompanyId = readNonEmptyString(context?.invocationScope?.companyId);
|
||||
const explicitCompanyId = Object.prototype.hasOwnProperty.call(params ?? {}, "companyId")
|
||||
? params.companyId ?? null
|
||||
: undefined;
|
||||
return services.config.get(
|
||||
explicitCompanyId === undefined
|
||||
? (scopedCompanyId ? { companyId: scopedCompanyId } : {})
|
||||
: { companyId: explicitCompanyId },
|
||||
);
|
||||
}),
|
||||
|
||||
"localFolders.declarations": gated("localFolders.declarations", async (params) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue