diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-23 14:41:48 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-23 14:41:48 +0700 |
| commit | ae475a8d1dc9fa291d079e00d4194c55a0bb408c (patch) | |
| tree | 82a7d96f161e1c0b2ece24171bd5ac3d4f4484d7 /indoteknik_api | |
| parent | 6538d8958c541e208df9a5fd83d5bdd5a0ae021c (diff) | |
| parent | de4a6c2c2ce115d169a3a85548ff95c8789e25c8 (diff) | |
Merge branch 'release' of bitbucket.org:altafixco/indoteknik-addons into release
Diffstat (limited to 'indoteknik_api')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_api/controllers/api_v1/wati.py | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/__init__.py b/indoteknik_api/controllers/api_v1/__init__.py index 63540928..df89fcaf 100644 --- a/indoteknik_api/controllers/api_v1/__init__.py +++ b/indoteknik_api/controllers/api_v1/__init__.py @@ -20,3 +20,4 @@ from . import brand_homepage from . import customer from . import content from . import midtrans +from . import wati diff --git a/indoteknik_api/controllers/api_v1/wati.py b/indoteknik_api/controllers/api_v1/wati.py new file mode 100644 index 00000000..68ff1640 --- /dev/null +++ b/indoteknik_api/controllers/api_v1/wati.py @@ -0,0 +1,20 @@ +from .. import controller +from odoo import http +from odoo.http import request +import json + + +class Wati(controller.Controller): + prefix = '/api/v1/' + + @http.route(prefix + 'wati/notification', auth='none', type='json', csrf=False, cors='*', methods=['POST', 'OPTIONS']) + def notification(self, **kw): + json_raw = json.loads(request.httprequest.data) + json_dump = json.dumps(json_raw, indent=4, sort_keys=True) + + request.env['wati.notification'].create([{ + 'json_raw': json_dump, + 'is_lead': False + }]) + + return |
