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:
parent
5045fbce8b
commit
ba26b374ba
4 changed files with 110 additions and 84 deletions
14
src/redux/uploads/constants.ts
Normal file
14
src/redux/uploads/constants.ts
Normal 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',
|
||||
};
|
12
src/redux/uploads/mocks.ts
Normal file
12
src/redux/uploads/mocks.ts
Normal 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,
|
||||
}))
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue