diff --git a/frontend/src/Metamaps/Synapse.js b/frontend/src/Metamaps/Synapse.js index 29fcc790..8253d6ba 100644 --- a/frontend/src/Metamaps/Synapse.js +++ b/frontend/src/Metamaps/Synapse.js @@ -19,10 +19,11 @@ import Visualize from './Visualize' * - Metamaps.Topics */ +const noOp = () => {} const Synapse = { // this function is to retrieve a synapse JSON object from the database // @param id = the id of the synapse to retrieve - get: function (id, callback) { + get: function (id, callback = noOp) { // if the desired topic is not yet in the local topic repository, fetch it if (Metamaps.Synapses.get(id) == undefined) { $.ajax({ diff --git a/frontend/src/Metamaps/Topic.js b/frontend/src/Metamaps/Topic.js index 7632eb01..5be6cc57 100644 --- a/frontend/src/Metamaps/Topic.js +++ b/frontend/src/Metamaps/Topic.js @@ -28,11 +28,11 @@ import Visualize from './Visualize' * - Metamaps.Synapses * - Metamaps.Topics */ - +const noOp = () => {} const Topic = { // this function is to retrieve a topic JSON object from the database // @param id = the id of the topic to retrieve - get: function (id, callback) { + get: function (id, callback = noOp) { // if the desired topic is not yet in the local topic repository, fetch it if (Metamaps.Topics.get(id) == undefined) { $.ajax({