In my WebService, I need to update the DATEFIN
to today's date and the DATEDEBUT
to a date that is one year prior.
Currently, the setup looks like this:
At the moment, I am manually inputting the dates. How can I automate this process correctly?
getUpdatedNews(SVM, last) {
var payload = {
"HEADER": this.sh.getHeaderForRequest(),
"SVM": SVM,
"PERIODE": {
"DATEDEBUT": "2018-01-01",
"DATEFIN": "2021-01-01"
},
"LASTX": 0
}
return this.http.post < any[] > (this.getBaseUrl() + `/WLOLARTL`, payload);
}
This is how my getUpdatedNews() method looks like:
getUpdatedNews() {
return this.api.getNews(this.svm, 20)
.pipe(
map((response: {}) => {
// this.getDetails();
this.prepareData(response);
})
);
}
Any guidance on how to improve this would be highly appreciated. Thank you!