mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-20 05:39:40 +02:00
19 lines
515 B
TypeScript
19 lines
515 B
TypeScript
|
import { BaseAPI } from "~/api/_base";
|
||
|
|
||
|
const prefix = "/api";
|
||
|
|
||
|
export class OcrAPI extends BaseAPI {
|
||
|
|
||
|
// Currently unused in favor for the endpoint using asset names
|
||
|
async fileToTsv(file: File) {
|
||
|
const formData = new FormData();
|
||
|
formData.append("file", file);
|
||
|
return await this.requests.post(`${prefix}/ocr/file-to-tsv`, formData);
|
||
|
}
|
||
|
|
||
|
async assetToTsv(recipeSlug: string, assetName: string) {
|
||
|
return await this.requests.post(`${prefix}/ocr/asset-to-tsv`, { recipeSlug, assetName });
|
||
|
}
|
||
|
|
||
|
}
|