Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PIDM-42] fix(payment-status): payment position/option status not coherent #289

Merged
merged 11 commits into from
Feb 5, 2025
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { get, post, del, put } = require("../utility/axios_common");
const { get, post, del, put, patch } = require("../utility/axios_common");
const fs = require("fs");

const GPD_HOST = process.env.gpd_host;
Expand Down Expand Up @@ -208,7 +208,7 @@ function updateAndPublishDebtPosition(orgId, iupd, body) {
}

function updateTransferIbanMassive(orgId, oldIban, newIban) {
return post(GPD_HOST + `/organizations/${orgId}/transfers/update/iban`, {oldIban, newIban}, {
return patch(GPD_HOST + `/organizations/${orgId}/transfers?oldIban=${oldIban}`, {newIban}, {
timeout: API_TIMEOUT,
headers: {
"Ocp-Apim-Subscription-Key": process.env.API_SUBSCRIPTION_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ function post(url, body, config) {
});
}

function patch(url, body, config) {
return axios.patch(url, body, config)
.then(res => {
return res;
})
.catch(error => {
return error.response;
});
}

function put(url, body, config) {
return axios.put(url, body, config)
.then(res => {
Expand All @@ -42,4 +52,4 @@ function del(url, config) {
});
}

module.exports = {get, post, put, del}
module.exports = {get, post, patch, put, del}
Loading
Loading