24 lines
570 B
TypeScript
24 lines
570 B
TypeScript
import { Identifiable } from "@/data";
|
|
import { axios } from "@/api/index";
|
|
|
|
export enum UploadType {
|
|
Ipp = "IppScan",
|
|
DeanConsent = "DeanConsent",
|
|
Insurance = "NnwInsurance",
|
|
}
|
|
|
|
const CREATE_DOCUMENT_ENDPOINT = '/document';
|
|
const DOCUMENT_UPLOAD_ENDPOINT = '/document/:id/scan';
|
|
|
|
interface Document extends Identifiable {
|
|
description?: string;
|
|
type: UploadType;
|
|
}
|
|
|
|
export async function create(type: UploadType, content: File)
|
|
{
|
|
const response = await axios.post<Document>(CREATE_DOCUMENT_ENDPOINT, { type });
|
|
|
|
console.log(response.data);
|
|
}
|