refactor: edit type

This commit is contained in:
Net 2024-08-27 19:37:30 +07:00 committed by Methapon Metanipat
parent 381f1c18e6
commit d1133d0bc2
2 changed files with 15 additions and 6 deletions

View file

@ -18,12 +18,19 @@ const useOcr = defineStore('useOcrStore', () => {
},
) {
const res = await axios
.post(`${baseUrl}/`, payload.file, {
.post<{
document: string;
fields: { name: string; value: string }[];
result: string;
}>(`${baseUrl}/`, payload.file, {
headers: { 'Content-Type': payload.file?.type },
onUploadProgress: (e) => console.log(e),
})
.catch((e) => console.error(e));
// ]);
if (!res || res.status >= 400) return false;
return res.data;
}
return {