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:
@@ -83,7 +83,7 @@ export interface OpenDataFood {
|
||||
* @type {number}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
readonly id: number;
|
||||
id?: number;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataVersion}
|
||||
@@ -186,7 +186,6 @@ export interface OpenDataFood {
|
||||
* Check if a given object implements the OpenDataFood interface.
|
||||
*/
|
||||
export function instanceOfOpenDataFood(value: object): boolean {
|
||||
if (!('id' in value)) return false;
|
||||
if (!('version' in value)) return false;
|
||||
if (!('slug' in value)) return false;
|
||||
if (!('name' in value)) return false;
|
||||
@@ -209,7 +208,7 @@ export function OpenDataFoodFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'version': OpenDataVersionFromJSON(json['version']),
|
||||
'slug': json['slug'],
|
||||
'name': json['name'],
|
||||
@@ -235,6 +234,7 @@ export function OpenDataFoodToJSON(value?: OpenDataFood | null): any {
|
||||
}
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'version': OpenDataVersionToJSON(value['version']),
|
||||
'slug': value['slug'],
|
||||
'name': value['name'],
|
||||
|
||||
Reference in New Issue
Block a user