Пример #1
0
 def deleteOrder(self, order_id):
     order_dao = OrderDAO()
     resourceOrders_dao = ResourceOrdersDAO()
     if not order_dao.getOrderById(order_id):
         return jsonify(Error="Order not found."), 404
     else:
         resourceOrders_dao.delete(order_id)
         order_dao.delete(order_id)
         return jsonify(DeleteStatus="OK"), 200
Пример #2
0
    def deleteOrder(self, oid):
        dao = OrderDAO()

        if dao.delete(oid):
            return jsonify(DeleteStatus="Order deleted"), 200
        else:
            return jsonify(Error="Order not found."), 404