docs
This commit is contained in:
50
API.supplier.md
Normal file
50
API.supplier.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# supplier
|
||||
|
||||
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
|
||||
|
||||
## `supplier.create`
|
||||
|
||||
*Source: `src/store/supplier/create.js`*
|
||||
|
||||
Creates a new supplier for a company, recording history.
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const supplier = await fn(42, 1, { name: 'Acme Supplies' });
|
||||
// => { id, name, createdAt, updatedAt }
|
||||
```
|
||||
|
||||
## `supplier.delete`
|
||||
|
||||
*Source: `src/store/supplier/delete.js`*
|
||||
|
||||
Deletes a supplier by its id within a company.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 1, 5);
|
||||
```
|
||||
|
||||
## `supplier.list`
|
||||
|
||||
*Source: `src/store/supplier/list.js`*
|
||||
|
||||
Lists the suppliers of a company.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const suppliers = await fn(42, 1);
|
||||
// => [{ id, name, createdAt, updatedAt }]
|
||||
```
|
||||
|
||||
## `supplier.update`
|
||||
|
||||
*Source: `src/store/supplier/update.js`*
|
||||
|
||||
Updates the name of a supplier, recording history.
|
||||
|
||||
```js
|
||||
const fn = update(pool);
|
||||
const supplier = await fn(42, 1, 5, { name: 'Acme GmbH' });
|
||||
// => { id, name, createdAt, updatedAt }
|
||||
```
|
||||
Reference in New Issue
Block a user