Skip to content

Commit

Permalink
specify _all as target in ClearCacheModal
Browse files Browse the repository at this point in the history
When none of the indices are selected, ClearCacheModal makes call to
`//_cache/clear` path. Here, the intention is to clear the cache for
all indices, let's make it explicit by passing `_all` as target.

New call: `/_all/_cache/clear`

Signed-off-by: Rohit Ashiwal <[email protected]>
  • Loading branch information
r1walz committed Mar 27, 2024
1 parent b151b85 commit 62e3ded
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/containers/ClearCacheModal/ClearCacheModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function ClearCacheModal(props: ClearCacheModalProps) {
const result = await services.commonService.apiCaller({
endpoint: "indices.clearCache",
data: {
index: unBlockedItems.join(","),
index: unBlockedItems.join(",") || "_all",
},
});
if (result && result.ok) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe("<IndicesActions /> spec", () => {
expect(browserServicesMock.commonService.apiCaller).toHaveBeenCalledWith({
endpoint: "indices.clearCache",
data: {
index: "",
index: "_all",
},
});
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -238,7 +238,7 @@ describe("<IndicesActions /> spec", () => {
expect(browserServicesMock.commonService.apiCaller).toHaveBeenCalledWith({
endpoint: "indices.clearCache",
data: {
index: "",
index: "_all",
},
});
expect(coreServicesMock.notifications.toasts.addError).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit 62e3ded

Please sign in to comment.