mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
15 lines
444 B
TypeScript
15 lines
444 B
TypeScript
import uuid from 'uuid4';
|
|
import { IResultWithStatus, IFile, UUID } from '../types';
|
|
import { HTTP_RESPONSES } from '~/utils/api';
|
|
import { EMPTY_FILE } from './constants';
|
|
|
|
export const uploadMock = ({ temp_id, file }: { temp_id: UUID; file: File }): Promise<IResultWithStatus<IFile>> => (
|
|
Promise.resolve({
|
|
status: HTTP_RESPONSES.CREATED,
|
|
data: {
|
|
...EMPTY_FILE,
|
|
id: uuid(),
|
|
temp_id,
|
|
},
|
|
error: null,
|
|
}));
|