From 73d0580871b919d6b2f32b753dd04d48cc86fbea Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Sun, 3 Jan 2021 08:56:41 -0800 Subject: [TMA - 459] - Fix for ghost image bug (#159) * Fixed * Fix --- src/store/actions/userMoments.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/store/actions') diff --git a/src/store/actions/userMoments.ts b/src/store/actions/userMoments.ts index dce8da8a..4d739129 100644 --- a/src/store/actions/userMoments.ts +++ b/src/store/actions/userMoments.ts @@ -1,7 +1,7 @@ import {RootState} from '../rootReducer'; import {loadMoments} from '../../services'; import {Action, ThunkAction} from '@reduxjs/toolkit'; -import {userMomentsFetched} from '../reducers'; +import {userMomentsFetched, momentCategoryDeleted} from '../reducers'; import {getTokenOrLogout} from '../../utils'; export const loadUserMoments = ( @@ -20,3 +20,18 @@ export const loadUserMoments = ( console.log(error); } }; + +export const deleteUserMomentsForCategory = ( + category: string, +): ThunkAction, RootState, unknown, Action> => async ( + dispatch, +) => { + try { + dispatch({ + type: momentCategoryDeleted.type, + payload: category, + }); + } catch (error) { + console.log(error); + } +}; -- cgit v1.2.3-70-g09d2