-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBacklog.js
More file actions
27 lines (22 loc) · 787 Bytes
/
Backlog.js
File metadata and controls
27 lines (22 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* eslint-env amd, browser */
/* global Artnum */
'use strict'
;(function () {
var global = Function('return this')() // eslint-disable-line
if (typeof global.Artnum === 'undefined' || typeof global.Artnum.Path === 'undefined') {
throw Error('Artnum.Path not found')
}
global.Artnum.Backlog = (function () {
var Backlog = function (msg, json) {
try {
fetch(Artnum.Path.url('backlog'), {method: 'POST', body: JSON.stringify({message: msg, details: json, trace: new Error().trace}), credential: 'same-origin'})
} catch (e) {
console.log('Backloging to server fail')
}
}
return Backlog
}())
if (typeof define === 'function' && define.amd) {
define(['artnum/Backlog'], function () { return global.Artnum.Doc })
}
}())