mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
editor displaying errors
This commit is contained in:
parent
09b68c19d2
commit
38a4c8e6a6
6 changed files with 40 additions and 11 deletions
|
@ -9,8 +9,8 @@ export interface IModalState {
|
|||
}
|
||||
|
||||
const INITIAL_STATE: IModalState = {
|
||||
is_shown: false,
|
||||
dialog: null,
|
||||
is_shown: true,
|
||||
dialog: DIALOGS.EDITOR_IMAGE,
|
||||
};
|
||||
|
||||
export default createReducer(INITIAL_STATE, MODAL_HANDLERS);
|
||||
|
|
|
@ -14,6 +14,7 @@ export const postNode = ({
|
|||
.post(API.NODE.SAVE, { node }, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
// .then(console.log);
|
||||
|
||||
export const getNodes = ({
|
||||
skip = 0,
|
||||
|
|
|
@ -43,7 +43,7 @@ const setTags = (state: INodeState, { tags }: ReturnType<typeof nodeSetTags>) =>
|
|||
assocPath(['current', 'tags'], tags, state);
|
||||
|
||||
export const NODE_HANDLERS = {
|
||||
[NODE_ACTIONS.SAVE]: setSaveErrors,
|
||||
[NODE_ACTIONS.SET_SAVE_ERRORS]: setSaveErrors,
|
||||
[NODE_ACTIONS.SET_LOADING]: setLoading,
|
||||
[NODE_ACTIONS.SET_LOADING_COMMENTS]: setLoadingComments,
|
||||
[NODE_ACTIONS.SET_CURRENT]: setCurrent,
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import { IState } from '../store';
|
||||
import { INodeState } from './reducer';
|
||||
import { IResultWithStatus, INode } from '../types';
|
||||
|
||||
export const selectNode = (state: IState): INodeState => state.node;
|
||||
|
||||
// export const catchNodeErrors = (data: IResultWithStatus<INode>): IResultWithStatus<INode> => ({
|
||||
// data,
|
||||
// errors: data.errors,
|
||||
// })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue