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

Function unarchiveElement

app/core/api/archived-elements.js:37–56  ·  view source on GitHub ↗
(_id, elementType)

Source from the content-addressed store, hash-verified

35 * @async
36 */
37export const unarchiveElement = (_id, elementType) => {
38 if (!me.isAdmin()) {
39 throw new Error('Admin access required')
40 }
41
42 if (!_id) {
43 throw new Error('You must pass an \'_id\' to be un-archived')
44 }
45
46 if (!elementType) {
47 throw new Error('You must pass an \'elementType\' to be un-archived')
48 }
49
50 return fetchJson(`/db/archived-elements/${_id}`, {
51 method: 'PUT',
52 json: {
53 elementType
54 }
55 })
56}

Callers

nothing calls this directly

Calls 1

isAdminMethod · 0.80

Tested by

no test coverage detected