code cleanup, fix errors

This commit is contained in:
Matthew Penner 2021-09-12 15:56:47 -06:00
parent 8acce201d6
commit 222300ff17
No known key found for this signature in database
GPG key ID: 030E4AB751DC756F
8 changed files with 58 additions and 57 deletions

View file

@ -6,7 +6,7 @@ export interface FlashStore {
items: FlashMessage[];
addFlash: Action<FlashStore, FlashMessage>;
addError: Action<FlashStore, { message: string; key?: string }>;
clearAndAddHttpError: Action<FlashStore, { error: any, key?: string }>;
clearAndAddHttpError: Action<FlashStore, { error: any; key?: string }>;
clearFlashes: Action<FlashStore, string | void>;
}
@ -29,8 +29,8 @@ const flashes: FlashStore = {
state.items.push({ type: 'error', title: 'Error', ...payload });
}),
clearAndAddHttpError: action((state, { key, error }) => {
state.items = [ { type: 'error', title: 'Error', key, message: httpErrorToHuman(error) } ];
clearAndAddHttpError: action((state, payload) => {
state.items = [ { type: 'error', title: 'Error', key: payload.key, message: httpErrorToHuman(payload.error) } ];
}),
clearFlashes: action((state, payload) => {