Skip to content

Commit

Permalink
fix: invalidate entries in release after bulk release or on deleting …
Browse files Browse the repository at this point in the history
…a release action
  • Loading branch information
madhurisandbhor committed Apr 5, 2024
1 parent 64d22b0 commit 156fdd3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/core/content-releases/admin/src/services/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type GetReleasesTabResponse = GetReleases.Response & {
const releaseApi = createApi({
reducerPath: pluginId,
baseQuery: axiosBaseQuery,
tagTypes: ['Release', 'ReleaseAction'],
tagTypes: ['Release', 'ReleaseAction', 'EntriesInRelease'],
endpoints: (build) => {
return {
getReleasesForEntry: build.query<
Expand Down Expand Up @@ -201,6 +201,7 @@ const releaseApi = createApi({
invalidatesTags: [
{ type: 'Release', id: 'LIST' },
{ type: 'ReleaseAction', id: 'LIST' },
{ type: 'EntriesInRelease', id: 'LIST' },
],
}),
updateReleaseAction: build.mutation<
Expand Down Expand Up @@ -255,7 +256,7 @@ const releaseApi = createApi({
invalidatesTags: (result, error, arg) => [
{ type: 'Release', id: 'LIST' },
{ type: 'Release', id: arg.params.releaseId },
{ type: 'ReleaseAction', id: 'LIST' },
{ type: 'EntriesInRelease', id: 'LIST' },
],
}),
publishRelease: build.mutation<PublishRelease.Response, PublishRelease.Request['params']>({
Expand All @@ -274,7 +275,10 @@ const releaseApi = createApi({
method: 'DELETE',
};
},
invalidatesTags: () => [{ type: 'Release', id: 'LIST' }],
invalidatesTags: () => [
{ type: 'Release', id: 'LIST' },
{ type: 'EntriesInRelease', id: 'LIST' },
],
}),
getMappedEntriesInReleases: build.query<
MapEntriesToReleases.Response,
Expand All @@ -289,6 +293,7 @@ const releaseApi = createApi({
},
};
},
providesTags: [{ type: 'EntriesInRelease', id: 'LIST' }],
}),
};
},
Expand Down

0 comments on commit 156fdd3

Please sign in to comment.