({ data }, options = {})
| 30 | * @returns {Promise<Object>} - Raw Interactive object |
| 31 | */ |
| 32 | export const putInteractive = ({ data }, options = {}) => { |
| 33 | if (!data) { |
| 34 | throw new Error('Please pass in a data property.') |
| 35 | } |
| 36 | const slugOrId = data.id || data.slug |
| 37 | if (!slugOrId) { |
| 38 | throw new Error('You must pass either a slug or ObjectId') |
| 39 | } |
| 40 | return fetchJson(`/db/interactive/${slugOrId}`, _.assign({}, options, { |
| 41 | method: 'PUT', |
| 42 | json: data |
| 43 | })) |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Creates a new interactive in the database. |
nothing calls this directly
no outgoing calls
no test coverage detected