def deleteAdmin(self, admin_id): dao = AdminDAO() if not dao.getAdminById(admin_id): return jsonify(Error="Admin not found."), 404 else: dao.delete(admin_id) return jsonify(DeleteStatus="OK"), 200
def deleteAdmin(self, admin_id): dao_admin = AdminDAO() if not dao_admin.getAdminById(admin_id): return jsonify(Error="Admin not found."), 404 else: dao_user = UserDAO() dao_phone = UserPhoneDAO() user_id = dao_admin.delete(admin_id) dao_phone.delete(user_id) dao_user.delete(user_id) return jsonify(DeleteStatus="OK"), 200