u
This commit is contained in:
15
API.brand.md
15
API.brand.md
@@ -39,7 +39,7 @@ Creates a brand for the user's selected company.
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{id: number, name: string, gsprpinfo: string|null, pics: Array<{id: number, sort: number, fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>}>` — The created brand.
|
||||
`Promise<{id: number, name: string, gsprpinfo: string|null, pics: Array<{fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>}>` — The created brand.
|
||||
|
||||
**Throws**
|
||||
|
||||
@@ -84,24 +84,27 @@ await store.brand.delete(42, 3);
|
||||
|
||||
*Source: `src/store/brand/list.js`*
|
||||
|
||||
Lists the brands of the user's selected company.
|
||||
Lists the brands of the user's selected company, sorted by name.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `[opts]` | `object` | Optional pagination options. |
|
||||
| `[opts.offset=0]` | `number` | Number of brands to skip. |
|
||||
| `[opts.limit=10]` | `number` | Number of brands to return (max 100). |
|
||||
| `[tx]` | `object` | Optional transaction to run within. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<Array<{id: number, name: string, gsprpinfo: string|null, pics: Array<{id: number, sort: number, fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>}>>` — The brands.
|
||||
`Promise<{brands: Array<{id: number, name: string, gsprpinfo: string|null, pics: Array<{fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>}>, total: number, offset: number, limit: number}>` — The brands plus the total unpaged count.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const brands = await store.brand.list(42);
|
||||
// => [{ id, name, gsprpinfo, pics: [{ sort, fullHash, thumbW, thumbH, thumbHash }] }]
|
||||
const result = await store.brand.list(42, { offset: 0, limit: 10 });
|
||||
// => { brands: [{ id, name, gsprpinfo, pics: [...] }], total: 25, offset: 0, limit: 10 }
|
||||
```
|
||||
|
||||
## `brand.update`
|
||||
@@ -154,7 +157,7 @@ Creates or updates a brand for the user's selected company, keyed by name.
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{id: number, name: string, gsprpinfo: string|null, pics: Array<{id: number, sort: number, fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>}>` — The upserted brand.
|
||||
`Promise<{id: number, name: string, gsprpinfo: string|null, pics: Array<{fullHash: string, thumbW: number, thumbH: number, thumbHash: string}>}>` — The upserted brand.
|
||||
|
||||
**Throws**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user