This commit is contained in:
Bernt Christian Egeland 2021-08-22 18:31:47 +02:00
parent 8a60c83494
commit 7a90dafc8f

View File

@ -18,7 +18,7 @@ const initialState = Object.freeze({
const Api = createContext(initialState); const Api = createContext(initialState);
function reducer(state, { type, payload, meta }) { function reducer(state, { type, payload }) {
switch (type) { switch (type) {
case 'REQUEST': { case 'REQUEST': {
const { url, fetchId } = payload; const { url, fetchId } = payload;
@ -36,9 +36,8 @@ function reducer(state, { type, payload, meta }) {
} }
case 'DELETE': { case 'DELETE': {
const { eventId } = payload; const { eventId } = payload;
return produce(state, (draftState) => { return produce(state, (draftState) => {
Object.keys(draftState.queries).map((url, index) => { Object.keys(draftState.queries).map((url) => {
draftState.queries[url].deletedId = eventId; draftState.queries[url].deletedId = eventId;
}); });
}); });