improved error loggin and updated imports to fix build failure

This commit is contained in:
2024-06-19 15:06:28 +01:00
parent d01179c724
commit be99db0774
78 changed files with 319 additions and 325 deletions
+4 -11
View File
@@ -37,8 +37,6 @@ export default async function ApiProxy(req, res) {
var data = JSON.stringify(req.body);
var queryUrl = "pinswg_watchlists";
console.log(data);
var config = {
method: "post",
url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
@@ -46,24 +44,19 @@ export default async function ApiProxy(req, res) {
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json",
"Prefer": 'odata.include-annotations="*"',
"Prefer": 'odata.include-annotations="*",return=representation',
"Authorization": "Bearer " + token.access_token,
"Content-Type": "application/json",
},
data: data,
};
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
console.log(data);
return axios(config)
.then(({ data }) => {
res.status(200).json(data);
})
.catch((err) => {
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
console.log(data);
console.log(consoleLogger(err));
res.status(400).json(err);
.catch((error) => {
consoleLogger(Object.assign(err, data));
res.status(400).json(error);
});
}