diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-02-16 13:49:18 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-02-16 13:49:18 +0700 |
| commit | 57b12c36df829ab358a68a5356c3549cf9714900 (patch) | |
| tree | 7ec39051cbf72dcbfbdfba42f8d41c9eb2c99afa /indoteknik_api/controllers/api_v1 | |
| parent | 0f99be075d857fb6bc7985b0fe8b429f53d3a9a0 (diff) | |
add wati notification handle
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_api/controllers/api_v1/wati.py | 18 |
2 files changed, 19 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..009ea244 --- /dev/null +++ b/indoteknik_api/controllers/api_v1/wati.py @@ -0,0 +1,18 @@ +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) + + request.env['wati.notification'].create([{ + 'json_raw': json_raw + }]) + + return |
