mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	* feat: ✨ paprika support - partial * feat: ✨ add full paprika support * re-organize data directory * add data directory auto-gen * rewrite migration tests * remove print statements * remove hard-coded paths * add auto-tag support * add mealie migration support * add looking for migraiton button
		
			
				
	
	
		
			30 lines
		
	
	
		
			790 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			790 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { BaseAPI } from "../_base";
 | |
| import { ReportSummary } from "./group-reports";
 | |
| 
 | |
| const prefix = "/api";
 | |
| 
 | |
| export type SupportedMigration = "nextcloud" | "chowdown" | "mealie_alpha" | "paprika";
 | |
| 
 | |
| export interface MigrationPayload {
 | |
|   addMigrationTag: boolean;
 | |
|   migrationType: SupportedMigration;
 | |
|   archive: File;
 | |
| }
 | |
| 
 | |
| const routes = {
 | |
|   base: `${prefix}/groups/migrations`,
 | |
| };
 | |
| 
 | |
| export class GroupMigrationApi extends BaseAPI {
 | |
|   async startMigration(payload: MigrationPayload) {
 | |
|     const form = new FormData();
 | |
|     form.append("add_migration_tag", String(payload.addMigrationTag));
 | |
|     form.append("migration_type", payload.migrationType);
 | |
|     form.append("archive", payload.archive);
 | |
| 
 | |
|     console.log(form);
 | |
| 
 | |
|     return await this.requests.post<ReportSummary>(routes.base, form);
 | |
|   }
 | |
| }
 |