From 9baaa1c10b2d9262d024ef29878b1a538ce7fde6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fiona=20Helena=20B=C3=BCttner?= Date: Sat, 5 Oct 2024 12:55:12 +0200 Subject: [PATCH] fixed postRequest for TimeSeriesData --- .../components/SubmodelPlugins/TimeSeriesData.vue | 2 +- aas-web-ui/src/mixins/RequestHandling.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/aas-web-ui/src/components/SubmodelPlugins/TimeSeriesData.vue b/aas-web-ui/src/components/SubmodelPlugins/TimeSeriesData.vue index d350de9..a72d2c6 100644 --- a/aas-web-ui/src/components/SubmodelPlugins/TimeSeriesData.vue +++ b/aas-web-ui/src/components/SubmodelPlugins/TimeSeriesData.vue @@ -479,7 +479,7 @@ let context = 'fetching data from Time Series Database'; let disableMessage = false; // send the request - this.postRequest(path, content, headers, context, disableMessage).then((response: any) => { + this.postRequest(path, content, headers, context, disableMessage, true).then((response: any) => { if (response.success) { // this.navigationStore.dispatchSnackbar({ status: true, timeout: 2000, color: 'success', btnColor: 'buttonText', text: 'Succesfully retrieved data!' }); this.convertInfluxCSVtoArray(response.data); diff --git a/aas-web-ui/src/mixins/RequestHandling.ts b/aas-web-ui/src/mixins/RequestHandling.ts index 3085d96..c8c8b9e 100644 --- a/aas-web-ui/src/mixins/RequestHandling.ts +++ b/aas-web-ui/src/mixins/RequestHandling.ts @@ -93,8 +93,17 @@ export default defineComponent({ }, // Function to send post Request which returns a Promise - postRequest(path: string, body: any, headers: Headers, context: string, disableMessage: boolean): any { - headers = this.addAuthorizationHeader(headers); // Add the Authorization header + postRequest( + path: string, + body: any, + headers: Headers, + context: string, + disableMessage: boolean, + isTSRequest: boolean = false + ): any { + if (!isTSRequest) { + headers = this.addAuthorizationHeader(headers); // Add the Authorization header + } return fetch(path, { method: 'POST', body: body, headers: headers }) .then((response) => { // Check if the Server responded with content