Skip to content

Commit

Permalink
Progress commit. Added api mixin fetchDatasetCollections and possibly…
Browse files Browse the repository at this point in the history
… delete restoration of fetchDatasetDisplayImage
  • Loading branch information
jorvis committed Jan 10, 2024
1 parent 6eeab98 commit 2ccb377
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion www/js/common.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ document.addEventListener('DOMContentLoaded', () => {
element.classList.add('is-hidden');
});

// activate the tools since the menu labels are hidden
// activate the tooltips since the menu labels are hidden
document.querySelectorAll('span.icon-image-part').forEach(function (element) {
element.classList.add('has-tooltip-right', 'has-tooltip-arrow');
});
Expand Down Expand Up @@ -639,6 +639,23 @@ const apiCallsMixin = {
const {data} = await axios.post("cgi/get_dataset_comparison.cgi", convertToFormData(payload));
return data;
},
async fetchDatasetCollections() {
const payload = {session_id: this.sessionId};
const {data} = await axios.post("cgi/get_user_layouts.cgi", convertToFormData(payload));
return data;
},
/**
* Fetches the display image for a dataset.
* @param {string} datasetId - The ID of the dataset.
* @param {string} displayId - The ID of the display.
* @returns {Promise<any>} - A promise that resolves to the fetched data.
*/
async fetchDatasetDisplayImage(datasetId, displayId) {
// POST due to payload variables being sensitive
const payload = {dataset_id: datasetId, display_id: displayId};
const {data} = await axios.post("/cgi/get_dataset_display_image.cgi", convertToFormData(payload));
return data;
},
/**
* Fetches datasets asynchronously.
* @returns {Promise<any>} The fetched data.
Expand Down

0 comments on commit 2ccb377

Please sign in to comment.