diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-01-06 15:40:18 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-01-06 15:40:18 +0700 |
| commit | 0917596321593241fd1727aba8922651eb988948 (patch) | |
| tree | 789ea846393c52a0937f3701983d2602ca3c353f | |
| parent | 20b3a41a6320d2680ad521e3552210e563b06948 (diff) | |
add offset and limit in video content api
| -rw-r--r-- | indoteknik_api/controllers/api_v1/content.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/content.py b/indoteknik_api/controllers/api_v1/content.py index 1b3f5dc2..3d18ac13 100644 --- a/indoteknik_api/controllers/api_v1/content.py +++ b/indoteknik_api/controllers/api_v1/content.py @@ -12,7 +12,9 @@ class WebsiteContent(controller.Controller): return self.response(code=401, description='Unauthorized') # base_url = request.env['ir.config_parameter'].get_param('web.base.url') query = [('status', '=', 'tayang'), ('slide_type', '=', 'video')] - videos = request.env['website.content'].search(query, order='sequence') + limit = int(kw.get('limit', 0)) + offset = int(kw.get('offset', 0)) + videos = request.env['website.content'].search(query, limit=limit, offset=offset, order='sequence') data = [] for video in videos: data.append({ |
