MCPcopy Create free account
hub / github.com/codecombat/codecombat / putInteractive

Function putInteractive

ozaria/site/api/interactive.js:32–44  ·  view source on GitHub ↗
({ data }, options = {})

Source from the content-addressed store, hash-verified

30 * @returns {Promise<Object>} - Raw Interactive object
31 */
32export 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected