From 602a670b2e2ce30bf2bdd6ff10a5f33444851f21 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 15 Mar 2023 14:04:29 -0500 Subject: [PATCH] useEntityActions: ensure the delete gets dispatched --- app/soapbox/entity-store/hooks/useEntityActions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/entity-store/hooks/useEntityActions.ts b/app/soapbox/entity-store/hooks/useEntityActions.ts index c1e40f37e..9402b9bc8 100644 --- a/app/soapbox/entity-store/hooks/useEntityActions.ts +++ b/app/soapbox/entity-store/hooks/useEntityActions.ts @@ -2,7 +2,7 @@ import { z } from 'zod'; import { useApi, useAppDispatch } from 'soapbox/hooks'; -import { importEntities } from '../actions'; +import { deleteEntities, importEntities } from '../actions'; import type { Entity } from '../types'; import type { EntitySchema } from './types'; @@ -58,6 +58,8 @@ function useEntityActions( if (!endpoints.delete) return Promise.reject(endpoints); return api.delete(endpoints.delete.replaceAll(':id', entityId)).then((response) => { + dispatch(deleteEntities([entityId], entityType)); + return { response, };