implemented pagination on Log apis

This commit is contained in:
smilerz 2021-09-07 07:35:17 -05:00
parent 16d125a243
commit 4d27a80cd5
7 changed files with 287 additions and 139 deletions

View File

@ -104,8 +104,7 @@ class TreeModel(MP_Node):
class Meta:
abstract = True
class PermissionModelMixin:
@staticmethod

View File

@ -33,21 +33,21 @@ def test_list_permission(arg, request):
def test_list_space(obj_1, obj_2, u1_s1, u1_s2, space_2):
assert len(json.loads(u1_s1.get(reverse(LIST_URL)).content)) == 2
assert len(json.loads(u1_s2.get(reverse(LIST_URL)).content)) == 0
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 2
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 0
obj_1.space = space_2
obj_1.save()
assert len(json.loads(u1_s1.get(reverse(LIST_URL)).content)) == 1
assert len(json.loads(u1_s2.get(reverse(LIST_URL)).content)) == 0
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 1
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 1
@pytest.mark.parametrize("arg", [
['a_u', 403],
['g1_s1', 404],
['g1_s1', 403], # changed expected value. based on list permissions the log is visible, but not editable
['u1_s1', 200],
['a1_s1', 404],
['a1_s1', 403], # changed expected value. based on list permissions the log is visible, but not editable
['g1_s2', 404],
['u1_s2', 404],
['a1_s2', 404],
@ -68,31 +68,29 @@ def test_update(arg, request, obj_1):
assert response['servings'] == 2
# TODO disabled until https://github.com/vabene1111/recipes/issues/484
# @pytest.mark.parametrize("arg", [
# ['a_u', 403],
# ['g1_s1', 201],
# ['u1_s1', 201],
# ['a1_s1', 201],
# ])
# def test_add(arg, request, u1_s2, u2_s1, recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# r = c.post(
# reverse(LIST_URL),
# {'recipe': recipe_1_s1.id},
# content_type='application/json'
# )
# response = json.loads(r.content)
# assert r.status_code == arg[1]
# if r.status_code == 201:
# assert response['recipe'] == recipe_1_s1.id
# r = c.get(reverse(DETAIL_URL, args={response['id']}))
# assert r.status_code == 200
# r = u2_s1.get(reverse(DETAIL_URL, args={response['id']}))
# assert r.status_code == 404
# r = u1_s2.get(reverse(DETAIL_URL, args={response['id']}))
# assert r.status_code == 404
@pytest.mark.parametrize("arg", [
['a_u', 403],
['g1_s1', 201],
['u1_s1', 201],
['a1_s1', 201],
])
def test_add(arg, request, u1_s2, u2_s1, recipe_1_s1):
c = request.getfixturevalue(arg[0])
r = c.post(
reverse(LIST_URL),
{'recipe': recipe_1_s1.id},
content_type='application/json'
)
assert r.status_code == arg[1]
if r.status_code == 201:
response = json.loads(r.content)
assert response['recipe'] == recipe_1_s1.id
r = c.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 200
r = u2_s1.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 403 # expected value changed. user can list the log - detail should be 403 as no reason to 'hide' that it actually exists
r = u1_s2.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 404
def test_delete(u1_s1, u1_s2, obj_1):

View File

@ -5,7 +5,7 @@ from django.contrib import auth
from django.urls import reverse
from django_scopes import scopes_disabled
from cookbook.models import Keyword, CookLog, ViewLog, ImportLog
from cookbook.models import ImportLog
LIST_URL = 'api:importlog-list'
DETAIL_URL = 'api:importlog-detail'
@ -33,14 +33,14 @@ def test_list_permission(arg, request):
def test_list_space(obj_1, obj_2, u1_s1, u1_s2, space_2):
assert len(json.loads(u1_s1.get(reverse(LIST_URL)).content)) == 2
assert len(json.loads(u1_s2.get(reverse(LIST_URL)).content)) == 0
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 2
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 0
obj_1.space = space_2
obj_1.save()
assert len(json.loads(u1_s1.get(reverse(LIST_URL)).content)) == 1
assert len(json.loads(u1_s2.get(reverse(LIST_URL)).content)) == 1
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 1
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 1
@pytest.mark.parametrize("arg", [

View File

@ -3,9 +3,8 @@ import json
import pytest
from django.contrib import auth
from django.urls import reverse
from django_scopes import scopes_disabled
from cookbook.models import RecipeBook, Storage, Sync, SyncLog
from cookbook.models import Storage, Sync, SyncLog
LIST_URL = 'api:synclog-list'
DETAIL_URL = 'api:synclog-detail'
@ -37,14 +36,14 @@ def test_list_permission(arg, request):
def test_list_space(obj_1, obj_2, a1_s1, a1_s2, space_2):
assert len(json.loads(a1_s1.get(reverse(LIST_URL)).content)) == 2
assert len(json.loads(a1_s2.get(reverse(LIST_URL)).content)) == 0
assert json.loads(a1_s1.get(reverse(LIST_URL)).content)['count'] == 2
assert json.loads(a1_s2.get(reverse(LIST_URL)).content)['count'] == 0
obj_1.sync.space = space_2
obj_1.sync.save()
assert len(json.loads(a1_s1.get(reverse(LIST_URL)).content)) == 1
assert len(json.loads(a1_s2.get(reverse(LIST_URL)).content)) == 1
assert json.loads(a1_s1.get(reverse(LIST_URL)).content)['count'] == 1
assert json.loads(a1_s2.get(reverse(LIST_URL)).content)['count'] == 1
@pytest.mark.parametrize("arg", [
@ -82,7 +81,6 @@ def test_add(arg, request, a1_s2, obj_1):
{'msg': 'test'},
content_type='application/json'
)
response = json.loads(r.content)
assert r.status_code == arg[1]

View File

@ -5,7 +5,7 @@ from django.contrib import auth
from django.urls import reverse
from django_scopes import scopes_disabled
from cookbook.models import Keyword, CookLog, ViewLog
from cookbook.models import ViewLog
LIST_URL = 'api:viewlog-list'
DETAIL_URL = 'api:viewlog-detail'
@ -33,14 +33,14 @@ def test_list_permission(arg, request):
def test_list_space(obj_1, obj_2, u1_s1, u1_s2, space_2):
assert len(json.loads(u1_s1.get(reverse(LIST_URL)).content)) == 2
assert len(json.loads(u1_s2.get(reverse(LIST_URL)).content)) == 0
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 2
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 0
obj_1.space = space_2
obj_1.save()
assert len(json.loads(u1_s1.get(reverse(LIST_URL)).content)) == 1
assert len(json.loads(u1_s2.get(reverse(LIST_URL)).content)) == 0
assert json.loads(u1_s1.get(reverse(LIST_URL)).content)['count'] == 1
assert json.loads(u1_s2.get(reverse(LIST_URL)).content)['count'] == 0
@pytest.mark.parametrize("arg", [
@ -52,6 +52,7 @@ def test_list_space(obj_1, obj_2, u1_s1, u1_s2, space_2):
['u1_s2', 404],
['a1_s2', 404],
])
# TODO: should logs be updateable at all?
def test_update(arg, request, obj_1):
c = request.getfixturevalue(arg[0])
r = c.patch(
@ -65,31 +66,29 @@ def test_update(arg, request, obj_1):
assert r.status_code == arg[1]
# TODO disabled until https://github.com/vabene1111/recipes/issues/484
# @pytest.mark.parametrize("arg", [
# ['a_u', 403],
# ['g1_s1', 201],
# ['u1_s1', 201],
# ['a1_s1', 201],
# ])
# def test_add(arg, request, u1_s2, u2_s1, recipe_1_s1):
# c = request.getfixturevalue(arg[0])
# r = c.post(
# reverse(LIST_URL),
# {'recipe': recipe_1_s1.id},
# content_type='application/json'
# )
# response = json.loads(r.content)
# assert r.status_code == arg[1]
# if r.status_code == 201:
# assert response['recipe'] == recipe_1_s1.id
# r = c.get(reverse(DETAIL_URL, args={response['id']}))
# assert r.status_code == 200
# r = u2_s1.get(reverse(DETAIL_URL, args={response['id']}))
# assert r.status_code == 404
# r = u1_s2.get(reverse(DETAIL_URL, args={response['id']}))
# assert r.status_code == 404
@pytest.mark.parametrize("arg", [
['a_u', 403],
['g1_s1', 201],
['u1_s1', 201],
['a1_s1', 201],
])
def test_add(arg, request, u1_s2, u2_s1, recipe_1_s1):
c = request.getfixturevalue(arg[0])
r = c.post(
reverse(LIST_URL),
{'recipe': recipe_1_s1.id},
content_type='application/json'
)
response = json.loads(r.content)
assert r.status_code == arg[1]
if r.status_code == 201:
assert response['recipe'] == recipe_1_s1.id
r = c.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 200
r = u2_s1.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 404
r = u1_s2.get(reverse(DETAIL_URL, args={response['id']}))
assert r.status_code == 404
def test_delete(u1_s1, u1_s2, obj_1):

View File

@ -119,7 +119,6 @@ class FuzzyFilterMixin(ViewSetMixin):
.filter(name__icontains=query).order_by('-exact')
)
updated_at = self.request.query_params.get('updated_at', None)
if updated_at is not None:
try:
@ -319,6 +318,7 @@ class SyncLogViewSet(viewsets.ReadOnlyModelViewSet):
queryset = SyncLog.objects
serializer_class = SyncLogSerializer
permission_classes = [CustomIsAdmin, ]
pagination_class = DefaultPagination
def get_queryset(self):
return self.queryset.filter(sync__space=self.request.space)
@ -598,35 +598,31 @@ class ViewLogViewSet(viewsets.ModelViewSet):
queryset = ViewLog.objects
serializer_class = ViewLogSerializer
permission_classes = [CustomIsOwner]
pagination_class = DefaultPagination
def get_queryset(self):
self.queryset = self.queryset.filter(created_by=self.request.user).filter(space=self.request.space).all()
if self.request.method == 'GET':
return self.queryset[:5]
else:
return self.queryset
# working backwards from the test - this is supposed to be limited to user view logs only??
return self.queryset.filter(created_by=self.request.user).filter(space=self.request.space)
class CookLogViewSet(viewsets.ModelViewSet):
queryset = CookLog.objects
serializer_class = CookLogSerializer
permission_classes = [CustomIsOwner]
permission_classes = [CustomIsOwner] # CustomIsShared? since ratings are in the cooklog?
pagination_class = DefaultPagination
def get_queryset(self):
self.queryset = self.queryset.filter(created_by=self.request.user).filter(space=self.request.space).all()
if self.request.method == 'GET':
return self.queryset[:5]
else:
return self.queryset
return self.queryset.filter(space=self.request.space)
class ImportLogViewSet(viewsets.ModelViewSet):
queryset = ImportLog.objects
serializer_class = ImportLogSerializer
permission_classes = [CustomIsUser]
pagination_class = DefaultPagination
def get_queryset(self):
return self.queryset.filter(space=self.request.space).all()
return self.queryset.filter(space=self.request.space)
class BookmarkletImportViewSet(viewsets.ModelViewSet):

View File

@ -119,6 +119,12 @@ export interface Food {
* @memberof Food
*/
name: string;
/**
*
* @type {string}
* @memberof Food
*/
description?: string;
/**
*
* @type {number}
@ -133,10 +139,10 @@ export interface Food {
ignore_shopping?: boolean;
/**
*
* @type {FoodSupermarketCategory}
* @type {number}
* @memberof Food
*/
supermarket_category?: FoodSupermarketCategory | null;
supermarket_category?: number | null;
/**
*
* @type {string}
@ -162,25 +168,6 @@ export interface Food {
*/
numrecipe?: string;
}
/**
*
* @export
* @interface FoodSupermarketCategory
*/
export interface FoodSupermarketCategory {
/**
*
* @type {number}
* @memberof FoodSupermarketCategory
*/
id?: number;
/**
*
* @type {string}
* @memberof FoodSupermarketCategory
*/
name: string;
}
/**
*
* @export
@ -489,11 +476,104 @@ export interface InlineResponse2003 {
previous?: string | null;
/**
*
* @type {Array<SupermarketCategoryRelation>}
* @type {Array<ViewLog>}
* @memberof InlineResponse2003
*/
results?: Array<ViewLog>;
}
/**
*
* @export
* @interface InlineResponse2004
*/
export interface InlineResponse2004 {
/**
*
* @type {number}
* @memberof InlineResponse2004
*/
count?: number;
/**
*
* @type {string}
* @memberof InlineResponse2004
*/
next?: string | null;
/**
*
* @type {string}
* @memberof InlineResponse2004
*/
previous?: string | null;
/**
*
* @type {Array<CookLog>}
* @memberof InlineResponse2004
*/
results?: Array<CookLog>;
}
/**
*
* @export
* @interface InlineResponse2005
*/
export interface InlineResponse2005 {
/**
*
* @type {number}
* @memberof InlineResponse2005
*/
count?: number;
/**
*
* @type {string}
* @memberof InlineResponse2005
*/
next?: string | null;
/**
*
* @type {string}
* @memberof InlineResponse2005
*/
previous?: string | null;
/**
*
* @type {Array<SupermarketCategoryRelation>}
* @memberof InlineResponse2005
*/
results?: Array<SupermarketCategoryRelation>;
}
/**
*
* @export
* @interface InlineResponse2006
*/
export interface InlineResponse2006 {
/**
*
* @type {number}
* @memberof InlineResponse2006
*/
count?: number;
/**
*
* @type {string}
* @memberof InlineResponse2006
*/
next?: string | null;
/**
*
* @type {string}
* @memberof InlineResponse2006
*/
previous?: string | null;
/**
*
* @type {Array<ImportLog>}
* @memberof InlineResponse2006
*/
results?: Array<ImportLog>;
}
/**
*
* @export
@ -742,6 +822,12 @@ export interface MealPlanRecipe {
* @memberof MealPlanRecipe
*/
last_cooked?: string;
/**
*
* @type {string}
* @memberof MealPlanRecipe
*/
_new?: string;
}
/**
*
@ -950,12 +1036,24 @@ export interface RecipeBookEntry {
* @memberof RecipeBookEntry
*/
book: number;
/**
*
* @type {string}
* @memberof RecipeBookEntry
*/
book_content?: string;
/**
*
* @type {number}
* @memberof RecipeBookEntry
*/
recipe: number;
/**
*
* @type {string}
* @memberof RecipeBookEntry
*/
recipe_content?: string;
}
/**
*
@ -1182,6 +1280,12 @@ export interface RecipeOverview {
* @memberof RecipeOverview
*/
last_cooked?: string;
/**
*
* @type {string}
* @memberof RecipeOverview
*/
_new?: string;
}
/**
*
@ -1760,6 +1864,12 @@ export interface StepFood {
* @memberof StepFood
*/
name: string;
/**
*
* @type {string}
* @memberof StepFood
*/
description?: string;
/**
*
* @type {number}
@ -1774,10 +1884,10 @@ export interface StepFood {
ignore_shopping?: boolean;
/**
*
* @type {FoodSupermarketCategory}
* @type {number}
* @memberof StepFood
*/
supermarket_category?: FoodSupermarketCategory | null;
supermarket_category?: number | null;
/**
*
* @type {string}
@ -4008,10 +4118,12 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCookLogs: async (options: any = {}): Promise<RequestArgs> => {
listCookLogs: async (page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/cook-log/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@ -4024,6 +4136,14 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['page_size'] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
@ -4091,10 +4211,12 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listImportLogs: async (options: any = {}): Promise<RequestArgs> => {
listImportLogs: async (page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/import-log/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@ -4107,6 +4229,14 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['page_size'] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
@ -4260,7 +4390,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
};
},
/**
*
* optional parameters - **recipe**: id of recipe - only return books for that recipe - **book**: id of book - only return recipes in that book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -4824,10 +4954,12 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listViewLogs: async (options: any = {}): Promise<RequestArgs> => {
listViewLogs: async (page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/view-log/`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@ -4840,6 +4972,14 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration)
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['page_size'] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
@ -8208,11 +8348,13 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listCookLogs(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CookLog>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listCookLogs(options);
async listCookLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2004>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listCookLogs(page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
@ -8231,11 +8373,13 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listImportLogs(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ImportLog>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listImportLogs(options);
async listImportLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2006>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listImportLogs(page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
@ -8280,7 +8424,7 @@ export const ApiApiFp = function(configuration?: Configuration) {
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* optional parameters - **recipe**: id of recipe - only return books for that recipe - **book**: id of book - only return recipes in that book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -8370,7 +8514,7 @@ export const ApiApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2003>> {
async listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2005>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listSupermarketCategoryRelations(page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
@ -8448,11 +8592,13 @@ export const ApiApiFp = function(configuration?: Configuration) {
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listViewLogs(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ViewLog>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listViewLogs(options);
async listViewLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2003>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listViewLogs(page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
@ -9762,11 +9908,13 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listCookLogs(options?: any): AxiosPromise<Array<CookLog>> {
return localVarFp.listCookLogs(options).then((request) => request(axios, basePath));
listCookLogs(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2004> {
return localVarFp.listCookLogs(page, pageSize, options).then((request) => request(axios, basePath));
},
/**
*
@ -9783,11 +9931,13 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listImportLogs(options?: any): AxiosPromise<Array<ImportLog>> {
return localVarFp.listImportLogs(options).then((request) => request(axios, basePath));
listImportLogs(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2006> {
return localVarFp.listImportLogs(page, pageSize, options).then((request) => request(axios, basePath));
},
/**
*
@ -9827,7 +9977,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
return localVarFp.listMealTypes(options).then((request) => request(axios, basePath));
},
/**
*
* optional parameters - **recipe**: id of recipe - only return books for that recipe - **book**: id of book - only return recipes in that book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
@ -9909,7 +10059,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2003> {
listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2005> {
return localVarFp.listSupermarketCategoryRelations(page, pageSize, options).then((request) => request(axios, basePath));
},
/**
@ -9978,11 +10128,13 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?:
},
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listViewLogs(options?: any): AxiosPromise<Array<ViewLog>> {
return localVarFp.listViewLogs(options).then((request) => request(axios, basePath));
listViewLogs(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2003> {
return localVarFp.listViewLogs(page, pageSize, options).then((request) => request(axios, basePath));
},
/**
*
@ -11313,12 +11465,14 @@ export class ApiApi extends BaseAPI {
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public listCookLogs(options?: any) {
return ApiApiFp(this.configuration).listCookLogs(options).then((request) => request(this.axios, this.basePath));
public listCookLogs(page?: number, pageSize?: number, options?: any) {
return ApiApiFp(this.configuration).listCookLogs(page, pageSize, options).then((request) => request(this.axios, this.basePath));
}
/**
@ -11338,12 +11492,14 @@ export class ApiApi extends BaseAPI {
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public listImportLogs(options?: any) {
return ApiApiFp(this.configuration).listImportLogs(options).then((request) => request(this.axios, this.basePath));
public listImportLogs(page?: number, pageSize?: number, options?: any) {
return ApiApiFp(this.configuration).listImportLogs(page, pageSize, options).then((request) => request(this.axios, this.basePath));
}
/**
@ -11392,7 +11548,7 @@ export class ApiApi extends BaseAPI {
}
/**
*
* optional parameters - **recipe**: id of recipe - only return books for that recipe - **book**: id of book - only return recipes in that book
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
@ -11577,12 +11733,14 @@ export class ApiApi extends BaseAPI {
/**
*
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public listViewLogs(options?: any) {
return ApiApiFp(this.configuration).listViewLogs(options).then((request) => request(this.axios, this.basePath));
public listViewLogs(page?: number, pageSize?: number, options?: any) {
return ApiApiFp(this.configuration).listViewLogs(page, pageSize, options).then((request) => request(this.axios, this.basePath));
}
/**