def delete_note(note_id): note = apks.find_note(note_id) if note is None: return utils.error('note {} not found'.format(note_id)) apks.delete_note(note_id) return jsonify({'success': True})
def add_note(apk_id): apk = apks.find_apk(apk_id) if apk is None: return utils.error('apk {} not found'.format(apk_id)) title = request.get_json().get('title') text = request.get_json().get('text') note = apks.add_note(title, text, apk_id) note['_id'] = str(note['_id']) # The front-end needs the note_id to simplify the delete functionality return jsonify(note)
def find_notes_by_apk(apk_id): notes = apks.find_notes_by_apk(apk_id) if notes is None: return utils.error('apk {} not found'.format(apk_id)) return jsonify(notes)
def find_flows_by_apk(apk_id): flows = apks.find_flows_by_apk(apk_id) if flows is None: return utils.error('apk {} not found'.format(apk_id)) return jsonify(flows)
def find_libs_by_apk(apk_id): libs = apks.find_libs_by_apk(apk_id) if libs is None: return utils.error('apk {} not found'.format(apk_id)) return jsonify(libs)