fixed recipe export with images

This commit is contained in:
vabene1111
2025-07-06 12:52:31 +02:00
parent dd921f1555
commit c238ea9136
4 changed files with 17 additions and 17 deletions

View File

@@ -19,12 +19,12 @@ import {
CustomFilterFromJSONTyped,
CustomFilterToJSON,
} from './CustomFilter';
import type { RecipeFlat } from './RecipeFlat';
import type { RecipeSimple } from './RecipeSimple';
import {
RecipeFlatFromJSON,
RecipeFlatFromJSONTyped,
RecipeFlatToJSON,
} from './RecipeFlat';
RecipeSimpleFromJSON,
RecipeSimpleFromJSONTyped,
RecipeSimpleToJSON,
} from './RecipeSimple';
/**
*
@@ -46,10 +46,10 @@ export interface ExportRequest {
all?: boolean;
/**
*
* @type {Array<RecipeFlat>}
* @type {Array<RecipeSimple>}
* @memberof ExportRequest
*/
recipes?: Array<RecipeFlat>;
recipes?: Array<RecipeSimple>;
/**
*
* @type {CustomFilter}
@@ -78,7 +78,7 @@ export function ExportRequestFromJSONTyped(json: any, ignoreDiscriminator: boole
'type': json['type'],
'all': json['all'] == null ? undefined : json['all'],
'recipes': json['recipes'] == null ? undefined : ((json['recipes'] as Array<any>).map(RecipeFlatFromJSON)),
'recipes': json['recipes'] == null ? undefined : ((json['recipes'] as Array<any>).map(RecipeSimpleFromJSON)),
'customFilter': json['custom_filter'] == null ? undefined : CustomFilterFromJSON(json['custom_filter']),
};
}
@@ -91,7 +91,7 @@ export function ExportRequestToJSON(value?: ExportRequest | null): any {
'type': value['type'],
'all': value['all'],
'recipes': value['recipes'] == null ? undefined : ((value['recipes'] as Array<any>).map(RecipeFlatToJSON)),
'recipes': value['recipes'] == null ? undefined : ((value['recipes'] as Array<any>).map(RecipeSimpleToJSON)),
'custom_filter': CustomFilterToJSON(value['customFilter']),
};
}

View File

@@ -30,13 +30,13 @@ export interface RecipeFlat {
* @type {string}
* @memberof RecipeFlat
*/
name: string;
readonly name: string;
/**
*
* @type {string}
* @memberof RecipeFlat
*/
image?: string;
readonly image: string | null;
}
/**
@@ -44,6 +44,7 @@ export interface RecipeFlat {
*/
export function instanceOfRecipeFlat(value: object): value is RecipeFlat {
if (!('name' in value) || value['name'] === undefined) return false;
if (!('image' in value) || value['image'] === undefined) return false;
return true;
}
@@ -59,19 +60,17 @@ export function RecipeFlatFromJSONTyped(json: any, ignoreDiscriminator: boolean)
'id': json['id'] == null ? undefined : json['id'],
'name': json['name'],
'image': json['image'] == null ? undefined : json['image'],
'image': json['image'],
};
}
export function RecipeFlatToJSON(value?: RecipeFlat | null): any {
export function RecipeFlatToJSON(value?: Omit<RecipeFlat, 'name'|'image'> | null): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'name': value['name'],
'image': value['image'],
};
}