mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 12:49:02 -05:00
posprocessing hook for DRF
This commit is contained in:
@@ -24,32 +24,13 @@ export interface RecipeShoppingUpdate {
|
||||
* @type {number}
|
||||
* @memberof RecipeShoppingUpdate
|
||||
*/
|
||||
readonly id: number;
|
||||
/**
|
||||
* Existing shopping list to update
|
||||
* @type {number}
|
||||
* @memberof RecipeShoppingUpdate
|
||||
*/
|
||||
listRecipe?: number;
|
||||
/**
|
||||
* List of ingredient IDs from the recipe to add, if not provided all ingredients will be added.
|
||||
* @type {number}
|
||||
* @memberof RecipeShoppingUpdate
|
||||
*/
|
||||
ingredients?: number;
|
||||
/**
|
||||
* Providing a list_recipe ID and servings of 0 will delete that shopping list.
|
||||
* @type {number}
|
||||
* @memberof RecipeShoppingUpdate
|
||||
*/
|
||||
servings?: number;
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the RecipeShoppingUpdate interface.
|
||||
*/
|
||||
export function instanceOfRecipeShoppingUpdate(value: object): boolean {
|
||||
if (!('id' in value)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,10 +44,7 @@ export function RecipeShoppingUpdateFromJSONTyped(json: any, ignoreDiscriminator
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
'listRecipe': json['list_recipe'] == null ? undefined : json['list_recipe'],
|
||||
'ingredients': json['ingredients'] == null ? undefined : json['ingredients'],
|
||||
'servings': json['servings'] == null ? undefined : json['servings'],
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -76,9 +54,7 @@ export function RecipeShoppingUpdateToJSON(value?: RecipeShoppingUpdate | null):
|
||||
}
|
||||
return {
|
||||
|
||||
'list_recipe': value['listRecipe'],
|
||||
'ingredients': value['ingredients'],
|
||||
'servings': value['servings'],
|
||||
'id': value['id'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user