code cleanup, fix errors
This commit is contained in:
parent
8acce201d6
commit
222300ff17
8 changed files with 58 additions and 57 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue