mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
working search with flat endpoint
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Django Recipes
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document:
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -13,15 +13,49 @@
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from '../runtime';
|
||||
import type { SupermarketCategoryToSupermarketInner } from './SupermarketCategoryToSupermarketInner';
|
||||
import type { SupermarketCategoryRelation } from './SupermarketCategoryRelation';
|
||||
import {
|
||||
SupermarketCategoryToSupermarketInnerFromJSON,
|
||||
SupermarketCategoryToSupermarketInnerFromJSONTyped,
|
||||
SupermarketCategoryToSupermarketInnerToJSON,
|
||||
} from './SupermarketCategoryToSupermarketInner';
|
||||
SupermarketCategoryRelationFromJSON,
|
||||
SupermarketCategoryRelationFromJSONTyped,
|
||||
SupermarketCategoryRelationToJSON,
|
||||
} from './SupermarketCategoryRelation';
|
||||
|
||||
/**
|
||||
* Moves `UniqueValidator`'s from the validation stage to the save stage.
|
||||
* It solves the problem with nested validation for unique fields on update.
|
||||
*
|
||||
* If you want more details, you can read related issues and articles:
|
||||
* https://github.com/beda-software/drf-writable-nested/issues/1
|
||||
* http://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers
|
||||
*
|
||||
* Example of usage:
|
||||
* ```
|
||||
* class Child(models.Model):
|
||||
* field = models.CharField(unique=True)
|
||||
*
|
||||
*
|
||||
* class Parent(models.Model):
|
||||
* child = models.ForeignKey('Child')
|
||||
*
|
||||
*
|
||||
* class ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
|
||||
* class Meta:
|
||||
* model = Child
|
||||
*
|
||||
*
|
||||
* class ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):
|
||||
* child = ChildSerializer()
|
||||
*
|
||||
* class Meta:
|
||||
* model = Parent
|
||||
* ```
|
||||
*
|
||||
* Note: `UniqueFieldsMixin` must be applied only on the serializer
|
||||
* which has unique fields.
|
||||
*
|
||||
* Note: When you are using both mixins
|
||||
* (`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)
|
||||
* you should put `UniqueFieldsMixin` ahead.
|
||||
* @export
|
||||
* @interface Supermarket
|
||||
*/
|
||||
@@ -31,7 +65,7 @@ export interface Supermarket {
|
||||
* @type {number}
|
||||
* @memberof Supermarket
|
||||
*/
|
||||
readonly id?: number;
|
||||
readonly id: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -46,10 +80,10 @@ export interface Supermarket {
|
||||
description?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Array<SupermarketCategoryToSupermarketInner>}
|
||||
* @type {Array<SupermarketCategoryRelation>}
|
||||
* @memberof Supermarket
|
||||
*/
|
||||
readonly categoryToSupermarket?: Array<SupermarketCategoryToSupermarketInner>;
|
||||
readonly categoryToSupermarket: Array<SupermarketCategoryRelation>;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -63,7 +97,9 @@ export interface Supermarket {
|
||||
*/
|
||||
export function instanceOfSupermarket(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "name" in value;
|
||||
isInstance = isInstance && "categoryToSupermarket" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
@@ -78,10 +114,10 @@ export function SupermarketFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
||||
}
|
||||
return {
|
||||
|
||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||
'id': json['id'],
|
||||
'name': json['name'],
|
||||
'description': !exists(json, 'description') ? undefined : json['description'],
|
||||
'categoryToSupermarket': !exists(json, 'category_to_supermarket') ? undefined : ((json['category_to_supermarket'] as Array<any>).map(SupermarketCategoryToSupermarketInnerFromJSON)),
|
||||
'categoryToSupermarket': ((json['category_to_supermarket'] as Array<any>).map(SupermarketCategoryRelationFromJSON)),
|
||||
'openDataSlug': !exists(json, 'open_data_slug') ? undefined : json['open_data_slug'],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user