Ejemplo n.º 1
0
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})
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)