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

Fixed postRequest for TimeSeriesData #47

Merged
merged 2 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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