end point receive

This commit is contained in:
Cayo Puigdefabregas 2020-11-19 17:00:30 +01:00
parent c75cdb2c60
commit a1eb0f4c90
2 changed files with 11 additions and 2 deletions

View File

@ -3,7 +3,7 @@ from typing import Callable, Iterable, Tuple
from teal.resource import Converters, Resource from teal.resource import Converters, Resource
from ereuse_devicehub.resources.action import schemas from ereuse_devicehub.resources.action import schemas
from ereuse_devicehub.resources.action.views import ActionView from ereuse_devicehub.resources.action.views import ActionView, ReceiveView
from ereuse_devicehub.resources.device.sync import Sync from ereuse_devicehub.resources.device.sync import Sync
@ -249,7 +249,7 @@ class DisposeProductDef(ActionDef):
class ReceiveDef(ActionDef): class ReceiveDef(ActionDef):
VIEW = None VIEW = ReceiveView
SCHEMA = schemas.Receive SCHEMA = schemas.Receive

View File

@ -6,6 +6,7 @@ import shutil
from datetime import datetime from datetime import datetime
from distutils.version import StrictVersion from distutils.version import StrictVersion
from uuid import UUID from uuid import UUID
from flask.json import jsonify
from flask import current_app as app, request, g from flask import current_app as app, request, g
from sqlalchemy.util import OrderedSet from sqlalchemy.util import OrderedSet
@ -168,3 +169,11 @@ class ActionView(View):
def transfer_ownership(self): def transfer_ownership(self):
"""Perform a InitTransfer action to change author_id of device""" """Perform a InitTransfer action to change author_id of device"""
pass pass
class ReceiveView(View):
def post(self):
return jsonify('Ok')
def find(self, args):
return jsonify('Ok find')