2020年12月22日星期二

angular service expected 1-2

I have api url like this:

https://example.com/api/tickets?filters=[{"field":"ticket_number","op":"like","value":"HT00002"}]  

And I've created service function like this:

getTableFilter(column: string, sort: string, value: string) {      const accessToken = store.get('accessToken')      const params = accessToken        ? {          headers: {            Authorization: `Token ${accessToken}`,            AccessToken: accessToken,          },        }        : {}      return this.http        .get(`${this.env.HELPDESK_LIST_FILTER}` + '[{field:' + column, + 'op:' + sort, + 'value:' + value + '}]', params)        .pipe(map((data) => data));  }  

Note: this.env.HELPDESK_LIST_FILTER is equal to 'https://example.com/api/tickets?filters=' in my env file

But I get this error

one

Any idea?

https://stackoverflow.com/questions/65418501/angular-service-expected-1-2 December 23, 2020 at 11:04AM

没有评论:

发表评论