51 lines
1.0 KiB
Markdown
51 lines
1.0 KiB
Markdown
# entitycontact
|
|
|
|
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
|
|
|
|
## `entitycontact.create`
|
|
|
|
*Source: `src/store/entitycontact/create.js`*
|
|
|
|
Creates a new contact for an entity.
|
|
|
|
```js
|
|
const fn = create(pool);
|
|
const contact = await fn(42, 1, 5, { contactType: 'email', contact: 'a@b.c' });
|
|
// => { id, entityId, contactType, contact, sort }
|
|
```
|
|
|
|
## `entitycontact.delete`
|
|
|
|
*Source: `src/store/entitycontact/delete.js`*
|
|
|
|
Deletes a contact of an entity.
|
|
|
|
```js
|
|
const fn = del(pool);
|
|
await fn(42, 1, 5, 9);
|
|
```
|
|
|
|
## `entitycontact.list`
|
|
|
|
*Source: `src/store/entitycontact/list.js`*
|
|
|
|
Lists the contacts of an entity.
|
|
|
|
```js
|
|
const fn = list(pool);
|
|
const contacts = await fn(42, 1, 5);
|
|
// => [{ id, entityId, contactType, contact, sort }]
|
|
```
|
|
|
|
## `entitycontact.update`
|
|
|
|
*Source: `src/store/entitycontact/update.js`*
|
|
|
|
Updates a contact of an entity.
|
|
|
|
```js
|
|
const fn = update(pool);
|
|
const contact = await fn(42, 1, 5, 9, { contact: 'b@c.d' });
|
|
// => { id, entityId, contactType, contact, sort }
|
|
```
|