Skip to content

Commit

Permalink
fixed postRequest for TimeSeriesData (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
fyo21103 authored Oct 5, 2024
1 parent 82b7be5 commit e207584
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 11 additions & 2 deletions aas-web-ui/src/mixins/RequestHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e207584

Please sign in to comment.