mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
empty file
This commit is contained in:
parent
5045fbce8b
commit
ba26b374ba
4 changed files with 110 additions and 84 deletions
|
@ -57,10 +57,10 @@ export interface IFile {
|
|||
size: number;
|
||||
|
||||
type: 'image' | 'text' | 'audio' | 'video';
|
||||
mime: MimeType;
|
||||
mime: string;
|
||||
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface INode {
|
||||
|
|
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