Use `params` from rtk-query
DmitryScaletta opened this issue · 1 comments
DmitryScaletta commented
You can rewrite this code
kinomore/src/services/KinomoreService.ts
Lines 13 to 15 in 0b0cfc5
using params
from rtk-query
getFilmById: build.query<IMovie, string | string[] | undefined>({
query: id => {
url: '/movie',
params: {
search: id,
field: 'id',
token: API_KEY,
},
},
}),
Documentation: https://redux-toolkit.js.org/rtk-query/api/fetchBaseQuery#setting-the-query-string
Shiyan7 commented
апи так не умеет. search=sometext&field=someField - такой запрос повторяется много раз