Add entity customer numbers and scope APIs via selected company.
Entity gets an optional unique-per-company number with allocate/peek/isNumberFree helpers. Company-scoped store methods no longer take companyId and resolve google_auth.selected_company instead.
This commit is contained in:
@@ -10,7 +10,7 @@ Deletes a company setting by key.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 1, 'theme');
|
||||
await fn(42, 'theme');
|
||||
```
|
||||
|
||||
## `companysetting.get`
|
||||
@@ -21,7 +21,7 @@ Returns a single company setting by key.
|
||||
|
||||
```js
|
||||
const fn = get(pool);
|
||||
const setting = await fn(42, 1, 'theme');
|
||||
const setting = await fn(42, 'theme');
|
||||
// => { key, value, frontend }
|
||||
```
|
||||
|
||||
@@ -33,7 +33,7 @@ Lists the settings of a company, optionally only frontend-visible ones.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const settings = await fn(42, 1, { frontendOnly: true });
|
||||
const settings = await fn(42, { frontendOnly: true });
|
||||
// => [{ key, value, frontend }]
|
||||
```
|
||||
|
||||
@@ -45,6 +45,6 @@ Sets (upserts) a company setting by key.
|
||||
|
||||
```js
|
||||
const fn = set(pool);
|
||||
const setting = await fn(42, 1, { key: 'theme', value: 'dark', frontend: true });
|
||||
const setting = await fn(42, { key: 'theme', value: 'dark', frontend: true });
|
||||
// => { key, value, frontend }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user