1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

created fake file uploader

This commit is contained in:
muerwre 2019-08-07 15:40:28 +07:00
parent d73437d8c6
commit 3eafd990cb
2 changed files with 9 additions and 6 deletions

View file

@ -3,6 +3,7 @@ import { eventChannel, END, EventChannel } from 'redux-saga';
import { VALIDATORS } from '~/utils/validators';
import { IResultWithStatus, IFile } from '~/redux/types';
import { HTTP_RESPONSES } from './api';
import { EMPTY_FILE } from '~/redux/uploads/constants';
export const IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg'];
@ -60,7 +61,7 @@ export const fakeUploader = ({
setTimeout(() => {
onProgress(2, 2);
if (mustSucceed) {
resolve({ status: HTTP_RESPONSES.CREATED, data: { id: uuid() } });
resolve({ status: HTTP_RESPONSES.CREATED, data: { ...EMPTY_FILE, id: uuid() } });
} else {
reject({ response: { statusText: error } });
}