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

empty file

This commit is contained in:
muerwre 2019-08-06 18:38:03 +07:00
parent 5045fbce8b
commit ba26b374ba
4 changed files with 110 additions and 84 deletions

View file

@ -0,0 +1,14 @@
import { IFile } from "~/redux/types";
export const EMPTY_FILE: IFile = {
id: null,
user_id: null,
node_id: null,
name: 'somefile.jpg',
path: '/covers/',
full_path: '/covers/somefile.jpg',
size: 2400000,
type: 'image',
mime: 'image/jpeg',
};

View file

@ -0,0 +1,12 @@
import { IResultWithStatus, IFile } from "../types";
import { HTTP_RESPONSES } from "~/utils/api";
export const uploadMock = (file: File): Promise<IResultWithStatus<IFile>> => (
Promise.resolve(() => ({
status: HTTP_RESPONSES.CREATED,
data: {
...EMPTY_FILE,
},
error: null,
}))
);