Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Fix node dependency vulns #14

Merged
merged 5 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions atlas-web-app/assets/js/api-request-delete-record.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Request deletion of record on client's behalf.
* @param id - id of the record to delete.
* @returns {Array} Tuple of [server_success, JSON_server_response].
*/
function requestDeleteRecord(id) {
var server_success;

var xhr = new XMLHttpRequest();

xhr.open('DELETE', '/record/'+ id);

xhr.onload = function () {
var responseJSON = JSON.parse(xhr.responseText);

// eslint-disable-next-line eqeqeq
if (xhr.readyState == 4 && xhr.status == '200') {
server_success = true;
return [server_success, responseJSON];
} else {
server_success = false;
return [server_success, responseJSON];
}
};

xhr.send(null);
}
27 changes: 27 additions & 0 deletions atlas-web-app/assets/js/api-request-get-record.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Request record on client's behalf.
* @param id - id of the record to get.
* @returns {Array} Tuple of [server_success, JSON_server_response].
*/
function requestGetRecord(id) {
var server_success;

var xhr = new XMLHttpRequest();

xhr.open('GET', '/record/'+ id);

xhr.onload = function () {
var responseJSON = JSON.parse(xhr.responseText);

// eslint-disable-next-line eqeqeq
if (xhr.readyState == 4 && xhr.status == '200') {
server_success = true;
return [server_success, responseJSON];
} else {
server_success = false;
return [server_success, responseJSON];
}
};

xhr.send(null);
}
18 changes: 0 additions & 18 deletions atlas-web-app/assets/js/requestDestroyRecord-func.js

This file was deleted.

Loading