mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed action
This commit is contained in:
parent
9778c9ba9a
commit
62e607c425
3 changed files with 13 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
import React, { ChangeEvent, FC, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
import React, { ChangeEvent, FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { TagAutocomplete } from '~/components/tags/TagAutocomplete';
|
import { TagAutocomplete } from '~/components/tags/TagAutocomplete';
|
||||||
import { TagWrapper } from '~/components/tags/TagWrapper';
|
import { TagWrapper } from '~/components/tags/TagWrapper';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
|
@ -3,6 +3,6 @@ const prefix = 'TAG.';
|
||||||
export const TAG_ACTIONS = {
|
export const TAG_ACTIONS = {
|
||||||
LOAD_NODES: `${prefix}LOAD_TAG_NODES`,
|
LOAD_NODES: `${prefix}LOAD_TAG_NODES`,
|
||||||
SET_TAG_NODES: `${prefix}SET_TAG_NODES`,
|
SET_TAG_NODES: `${prefix}SET_TAG_NODES`,
|
||||||
SET_TAG_AUTOCOMPLETE: `${prefix}SET_TAG_NODES`,
|
SET_TAG_AUTOCOMPLETE: `${prefix}SET_TAG_AUTOCOMPLETE`,
|
||||||
LOAD_AUTOCOMPLETE: `${prefix}LOAD_TAG_AUTOCOMPLETE`,
|
LOAD_AUTOCOMPLETE: `${prefix}LOAD_TAG_AUTOCOMPLETE`,
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,13 +2,17 @@ import { TAG_ACTIONS } from '~/redux/tag/constants';
|
||||||
import { ITagState } from '~/redux/tag/index';
|
import { ITagState } from '~/redux/tag/index';
|
||||||
import { tagSetAutocomplete, tagSetNodes } from '~/redux/tag/actions';
|
import { tagSetAutocomplete, tagSetNodes } from '~/redux/tag/actions';
|
||||||
|
|
||||||
const setNodes = (state: ITagState, { nodes }: ReturnType<typeof tagSetNodes>) => ({
|
const setNodes = (state: ITagState, { nodes }: ReturnType<typeof tagSetNodes>) => {
|
||||||
...state,
|
console.log(state, nodes);
|
||||||
nodes: {
|
|
||||||
...state.nodes,
|
return {
|
||||||
...nodes,
|
...state,
|
||||||
},
|
nodes: {
|
||||||
});
|
...state.nodes,
|
||||||
|
...nodes,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const setAutocomplete = (
|
const setAutocomplete = (
|
||||||
state: ITagState,
|
state: ITagState,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue