Skip to content

Commit

Permalink
Delete data when clearing security entity store (#197938)
Browse files Browse the repository at this point in the history
## Summary

Fixed a bug where the "Clear all entities" button in the security entity
store didn't delete data due to a missing query parameter.

(cherry picked from commit ffc8810)
  • Loading branch information
jaredburgettelastic committed Oct 28, 2024
1 parent 16cd659 commit 3f2543d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export const useEntityStoreRoutes = () => {
});
};

const deleteEntityEngine = async (entityType: EntityType) => {
const deleteEntityEngine = async (entityType: EntityType, deleteData: boolean) => {
return http.fetch<DeleteEntityEngineResponse>(`/api/entity_store/engines/${entityType}`, {
method: 'DELETE',
query: { data: deleteData },
version: API_VERSIONS.public.v1,
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const useDeleteEntityEngineMutation = (options?: UseMutationOptions<{}>)
const invalidateEntityEngineStatusQuery = useInvalidateEntityEngineStatusQuery();
const { deleteEntityEngine } = useEntityStoreRoutes();
return useMutation<DeleteEntityEngineResponse[]>(
() => Promise.all([deleteEntityEngine('user'), deleteEntityEngine('host')]),
() => Promise.all([deleteEntityEngine('user', true), deleteEntityEngine('host', true)]),
{
...options,
mutationKey: DELETE_ENTITY_ENGINE_STATUS_KEY,
Expand Down

0 comments on commit 3f2543d

Please sign in to comment.