У объекта тега могуть быть только type и id:
An individual tag has a type, represented as a string name, and an optional id, represented as a string or number. It can be represented as a plain string (such as 'Post'
), or an object in the shape {type: string, id?: string|number}
(such as [{type: 'Post', id: 1}]
).
https://redux-toolkit.js.org/rtk-query/usage/autom...
Так что вашу структуру нужно разделить на несколько тегов:
getInvoiceReviewTaskDetails: build.query<InvoiceReviewTaskDetails, number>({
...
providesTags: (response) =>
response ?
[
{ type: TagTypes.VendorInvoiceReview, id: response.id },
{ type: TagTypes.VendorInvoiceReview, id: `vendor-${response.vendor.id}` },
{ type: TagTypes.VendorInvoiceReview, id: `facility-${response.facility.id}` },
] : []
}),
updateInvoiceReviewTask: build.mutation<void, UpdateFacilityInvoiceReviewTaskRequest>({
...
invalidatesTags: (response, error, params) =>
[
{ type: TagTypes.VendorInvoiceReview, id: `vendor-${params.vendor_id}` },
{ type: TagTypes.VendorInvoiceReview, id: `facility-${params.facility_id}` },
]
})
Но можно обойтись и одним:
getInvoiceReviewTaskDetails: build.query<InvoiceReviewTaskDetails, number>({
...
providesTags: (response) =>
response ?
[{ type: TagTypes.VendorInvoiceReview, id: `vendor-${response.vendor.id},facility-${response.facility.id}` }] : []
}),
updateInvoiceReviewTask: build.mutation<void, UpdateFacilityInvoiceReviewTaskRequest>({
...
invalidatesTags: (response, error, params) =>
[{ type: TagTypes.VendorInvoiceReview, id: `vendor-${params.vendor_id},facility-${params.facility_id}` }]
})