def deleteFreeTime(): """ delete free time :return: json """ calendarId = session['User']['calendar_id'] freeId = request.form.getlist('freeid')[0] ds = DoctorService() res, data = ds.deleteFreeTime(calendarId, freeId) if res: return make_response( jsonify({ 'code': 1, 'msg': 'Successfully Deleted!' }), 201) else: return make_response(jsonify({'code': -1, 'msg': 'Failed'}), 400)
def deleteFreeTime(doctor_id): """ delete free time :param doctor_id: doctor id :return: json """ ds = DoctorService() res, data = ds.getDoctorById(doctor_id) calendarId = data['data']['calendar_id'] freeId = request.form.getlist('freeid')[0] res, data = ds.deleteFreeTime(calendarId, freeId) if res: return make_response( jsonify({ 'code': 1, 'msg': 'Successfully Deleted!' }), 201) else: return make_response(jsonify({'code': -1, 'msg': 'Failed'}), 400)