Skip to content

Commit

Permalink
Javascript standard style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Jul 28, 2023
1 parent 698c0cd commit 7d36d5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions open_search/static/open_search/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,11 @@ OpenSearchApi.call = async function (data = {}, options = {}) {
formData.append('data', JSON.stringify(data))

const errorResult = (msg = 'Your request could not be completed due to an internal error') =>
Promise.reject({ data: null, status: 'error_internal' })
Promise.reject({ // eslint-disable-line prefer-promise-reject-errors
data: null,
status: 'error_internal',
status_info: msg
})

let r = {}
try {
Expand All @@ -428,7 +432,7 @@ OpenSearchApi.call = async function (data = {}, options = {}) {
// API responses should either produce 200, 400 or 500.
// Any other status code indicates an internal error without (human-readable) information.
console.error(`API Error: HTTP status ${r.status}`)
return Promise.reject({ data: null, status: r.status })
return Promise.reject({ data: null, status: r.status }) // eslint-disable-line prefer-promise-reject-errors
}

let j = {}
Expand Down
9 changes: 8 additions & 1 deletion vault/static/vault/js/datapackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(document).ajaxSend(function (e, request, settings) {
})

let currentFolder
let bounds = [[1, 1][1, 1]]
let bounds = [[1, 1], [1, 1]]
let mymap = null
let maplayer = null

Expand Down Expand Up @@ -186,6 +186,13 @@ async function handleRestrictedMetadataInfo () {
formData.append(Yoda.csrf.tokenName, Yoda.csrf.tokenValue)
formData.append('data', JSON.stringify(data))

const errorResult = (msg = 'Your request could not be completed due to an internal error') =>
Promise.reject({ // eslint-disable-line prefer-promise-reject-errors
data: null,
status: 'error_internal',
status_info: msg
})

try {
const r = await fetch('/open_search/metadata', {
method: 'POST',
Expand Down

0 comments on commit 7d36d5e

Please sign in to comment.