Mutate the store after uploading
This commit is contained in:
parent
b4c64d3dc0
commit
f21aca20b2
1 changed files with 3 additions and 3 deletions
|
@ -10,6 +10,7 @@ import Fade from '@/components/elements/Fade';
|
||||||
import useEventListener from '@/plugins/useEventListener';
|
import useEventListener from '@/plugins/useEventListener';
|
||||||
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
||||||
import useFlash from '@/plugins/useFlash';
|
import useFlash from '@/plugins/useFlash';
|
||||||
|
import useFileManagerSwr from '@/plugins/useFileManagerSwr';
|
||||||
|
|
||||||
const InnerContainer = styled.div`
|
const InnerContainer = styled.div`
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
|
@ -20,6 +21,7 @@ export default () => {
|
||||||
const { uuid } = useServer();
|
const { uuid } = useServer();
|
||||||
const [ visible, setVisible ] = useState(false);
|
const [ visible, setVisible ] = useState(false);
|
||||||
const [ loading, setLoading ] = useState(false);
|
const [ loading, setLoading ] = useState(false);
|
||||||
|
const { mutate } = useFileManagerSwr();
|
||||||
const { clearFlashes, clearAndAddHttpError } = useFlash();
|
const { clearFlashes, clearAndAddHttpError } = useFlash();
|
||||||
|
|
||||||
useEventListener('dragenter', e => {
|
useEventListener('dragenter', e => {
|
||||||
|
@ -63,9 +65,7 @@ export default () => {
|
||||||
'Content-Type': 'multipart/form-data',
|
'Content-Type': 'multipart/form-data',
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
.then(res => {
|
.then(() => mutate())
|
||||||
console.log(res);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
clearAndAddHttpError({ error, key: 'files' });
|
clearAndAddHttpError({ error, key: 'files' });
|
||||||
|
|
Loading…
Reference in a new issue