(_id, elementType)
| 35 | * @async |
| 36 | */ |
| 37 | export 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 | } |