mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04: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 }); | ||
|  |   } | ||
|  | 
 | ||
|  | } |