refactor: Change the way data is sent

This commit is contained in:
Net 2024-08-29 14:55:57 +07:00
parent 3727627717
commit 31f0aa3120
3 changed files with 12 additions and 7 deletions

View file

@ -10,6 +10,7 @@ const useOcr = defineStore('useOcrStore', () => {
async function sendOcr(
payload: {
file: File;
category: string;
},
flow?: {
sessionId?: string;
@ -22,7 +23,7 @@ const useOcr = defineStore('useOcrStore', () => {
document: string;
fields: { name: string; value: string }[];
result: string;
}>(`${baseUrl}/`, payload.file, {
}>(`${baseUrl}/?category=${payload.category}`, payload.file, {
headers: { 'Content-Type': payload.file?.type },
onUploadProgress: (e) => console.log(e),
})