Пример #1
0
    def get(self, orderId: int):
        order = Order.findById(orderId)

        if order:
            return order.json(), 200
        else:
            return {"message": "order not found."}, 404
Пример #2
0
    def delete(self, orderId: int):

        order = Order.findById(orderId)

        if order:
            order.delete()
            return {"message": "Order deleted."}, 200
        else:
            return {"message": "Order not found."}, 404