Skip to content

Commit 4140f7b

Browse files
committed
ips-nmos-api: fix compiling
- 'import' can't be used outside of a module. - Fix syntax. - I don't get why `window` would be defined in a server app...
1 parent 8af43a7 commit 4140f7b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ips-nmos-api/src/http/route-bulk.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
var axios = require('axios')
1818
var constants = require('./constants')
1919

20-
export default (nmos, bulkStuff, fallback) => {
20+
module.export = function (nmos, bulkStuff, fallback) {
2121
var device = null
2222
return nmos.devices(bulkStuff.deviceID)
2323
.then((passedDevice) => {

src/ips-nmos-api/src/http/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
var axios = require('axios')
1818
var constants = require('./constants')
19-
import routeBulk from './route-bulk'
20-
import AddToken from './subscription/add-token'
19+
var routeBulk = require('./route-bulk')
20+
var AddToken = require('./subscription/add-token')
2121

2222
let addToken = AddToken()
2323

src/ips-nmos-api/src/http/subscription/add-token.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = () => {
22
const TOKEN_KEY = 'accessToken'
3-
if (!window.sessionStorage) {
3+
if (typeof window !== 'undefined' && !window.sessionStorage) {
44
console.error('Please use a browser that supports Session Storage')
55
return
66
}

0 commit comments

Comments
 (0)