I am trying to incorporate the body
query with the help of current redux store data
within the createApi function by updating the postBody
variable.
My objective is to access a specific redux node from the store and integrate its data with postBody, if feasible.
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'],
}),
}),
})