mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-20 06:34:40 +02:00
Add Nav-I dashboard section with restore-as conflict resolution
- Create Nav-I top-level section in dashboard navigation - Move Deleted Contacts from Knowledge subnav to Nav-I - Add Nav-I landing page with card grid (deleted count, API keys stub) - Add /nav-i/api-keys placeholder page - Add restore-as endpoint for Home/Work conflict resolution - Conflict modal in deleted contacts template for label rename on restore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a4288c0cd8
commit
3280e34718
7 changed files with 210 additions and 3 deletions
|
|
@ -102,6 +102,24 @@ def restore_contact(contact_id):
|
|||
return jsonify(contact)
|
||||
|
||||
|
||||
@contacts_bp.route('/api/contacts/<int:contact_id>/restore-as', methods=['POST'])
|
||||
@require_auth
|
||||
def restore_as_contact(contact_id):
|
||||
db = _get_db()
|
||||
data = request.get_json(force=True)
|
||||
new_label = data.get('label', '').strip()
|
||||
if not new_label:
|
||||
return jsonify({'error': 'label is required'}), 400
|
||||
contact, err = db.restore_as(request.user_id, contact_id, new_label)
|
||||
if err == 'not_found':
|
||||
return jsonify({'error': 'Not found'}), 404
|
||||
if err == 'invalid_label':
|
||||
return jsonify({'error': 'Invalid label'}), 400
|
||||
if err == 'conflict':
|
||||
return jsonify({'error': 'Label conflict'}), 409
|
||||
return jsonify(contact)
|
||||
|
||||
|
||||
@contacts_bp.route('/api/contacts/<int:contact_id>/purge', methods=['DELETE'])
|
||||
@require_auth
|
||||
def purge_contact(contact_id):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue