Example #1
0
 def deleteWater(self, waterid):
     dao = WaterDAO()
     if not dao.getWaterById(waterid):
         return jsonify(Error="Resource not found"), 404
     else:
         dao.delete(waterid)
         return jsonify(DeleteStatus="OK"), 200
Example #2
0
 def deleteWater(self, water_id):
     water_dao = WaterDAO()
     if not water_dao.getWaterById(water_id):
         return jsonify(Error="Water not found."), 404
     else:
         resource_id = water_dao.delete(water_id)
         resource_dao = ResourceDAO()
         resource_dao.delete(resource_id)
         return jsonify(DeleteStatus="OK"), 200