Skip to content

Commit

Permalink
fix wrong atom config fetch body keynames
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunday-Crunk committed Aug 14, 2024
1 parent f3c5f95 commit 04562cf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/4.4.1/main_4.4.1.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/js/core/CustomPreservationConfigs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
async function submitPreservationRequest(configId) {
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
const url = `${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`;
const url = `${window.location.origin}/a/scheduler/hooks/a3m-transfer`;
const paths = pydio._dataModel._selectedNodes.map(n => ({
path: Curate.workspaces.getOpenWorkspace() + n._path,
slug: n._metadata.get("usermeta-atom-linked-description") || ""
Expand Down Expand Up @@ -43,7 +43,7 @@
// Retrieves saved preservation configs from the server at route GET /api/preservation
// Stores the configs in sessionStorage under the key "preservationConfigs"
async function getPreservationConfigs() {
const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`;
const url = `${window.location.origin}/api/preservation`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {headers: {"Authorization": `Bearer ${token}`}, method: "GET"})
.then(response => {
Expand Down Expand Up @@ -743,7 +743,7 @@
}
}
async function deletePreservationConfig(id) {
const url = `${window.location.protocol}//${window.location.hostname}/preservation/${id}`;
const url = `${window.location.origin}/preservation/${id}`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: "DELETE",
Expand Down Expand Up @@ -775,7 +775,7 @@
}
// Saves the given preservation config to the server at route POST /preservation
async function setPreservationConfig(config) {
const url = `${window.location.protocol}//${window.location.hostname}/preservation`;
const url = `${window.location.origin}/preservation`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: "POST",
Expand Down Expand Up @@ -805,7 +805,7 @@
return input.replaceAll(" ", "_");
}
async function editPreservationConfig(config) {
const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${config.id}`;
const url = `${window.location.origin}/api/preservation/${config.id}`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: "POST",
Expand Down
8 changes: 4 additions & 4 deletions src/js/vanitizer/PreservationConfigsPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function createCuratePopup(title, inputs) {

}
async function getPreservationConfigs() {
const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`;
const url = `${window.location.origin}/api/preservation`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: 'GET',
Expand All @@ -234,7 +234,7 @@ async function getPreservationConfigs() {
});
}
async function editPreservationConfig(config) {
const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${config.id}`;
const url = `${window.location.origin}/api/preservation/${config.id}`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: "POST",
Expand All @@ -260,7 +260,7 @@ async function editPreservationConfig(config) {
});
}
async function setPreservationConfig(config) {
const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`;
const url = `${window.location.origin}/api/preservation`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: "POST",
Expand All @@ -286,7 +286,7 @@ async function setPreservationConfig(config) {
});
}
async function deletePreservationConfig(id) {
const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${id}`;
const url = `${window.location.origin}/api/preservation/${id}`;
const token = await PydioApi._PydioRestClient.getOrUpdateJwt();
return fetch(url, {
method: "DELETE",
Expand Down
6 changes: 3 additions & 3 deletions src/js/web-components/atom-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class ConnectToAtom extends HTMLElement {
saveDetails(e) {
e.preventDefault();
Curate.api.fetchCurate('/api/atom', 'POST', {
api_key: this.apiKey,
atom_api_key: this.apiKey,
atom_url: this.atomUrl,
username: this.username,
password: this.password
atom_username: this.username,
atom_password: this.password
})
.then(response => {
console.log('Saved Atom details:', response);
Expand Down

0 comments on commit 04562cf

Please sign in to comment.