I would like to make the query body
using current redux store data
in this createApi function changing the postBody
variable.
I mean I want to get a redux node here from the store and merge the data with postBody if that's possible.
export const loginIdentityApi = createApi({
reducerPath: 'loginIdentity',
baseQuery,
tagTypes: ['Login'],
endpoints: (build) => ({
postLogin: build.mutation<TApiResponse, TPostBody>({
query: (postBody: TPostBody) => ({
url: urlPrep(signin, {
updateCookies: true,
}),
method: 'POST',
body: postBody,
}),
transformResponse: (response: TApiResponse) => {
return response
},
invalidatesTags: ['Login'],
}),
}),
})