right now i try to do a http get request which sends the two dates "Start" and "End" to the backend:
let vacationDays = await this.http.get(this.baseUrl 'vacation/getVacationDays/' start end, { headers: this.getHeader() }).toPromise()
My router code looks like the following:
this.router.get('/getVacationDays/:start/:end', this.authHandler.isAuthed, (req, res) => this.getDBVacationDays(req, res))
I get no error, but with req.params.start, req.params.end I can not log the parameters. Can you help me out here? Greetings, Leo
CodePudding user response:
You forgot the slash sybmol between start
and end
let vacationDays = await this.http.get(this.baseUrl
`vacation/getVacationDays/${start}/${end}`,
{ headers: this.getHeader() }
).toPromise()
CodePudding user response:
So the problem was in the frontend code. Here is my solution:
let vacationDays = await this.http.get(this.baseUrl 'vacation/getVacationDays/' start '/' end, { headers: this.getHeader() }).toPromise()