updated database deployment and views
This commit is contained in:
@@ -2755,18 +2755,24 @@ def update_location():
|
||||
from app.warehouse import update_location
|
||||
try:
|
||||
data = request.get_json()
|
||||
print(f"DEBUG: Received update request data: {data}")
|
||||
|
||||
location_id = data.get('location_id')
|
||||
location_code = data.get('location_code')
|
||||
size = data.get('size')
|
||||
description = data.get('description')
|
||||
|
||||
print(f"DEBUG: Extracted values - ID: {location_id}, Code: {location_code}, Size: {size}, Description: {description}")
|
||||
|
||||
if not location_id or not location_code:
|
||||
return jsonify({'success': False, 'error': 'Location ID and code are required'})
|
||||
|
||||
result = update_location(location_id, location_code, size, description)
|
||||
print(f"DEBUG: Update result: {result}")
|
||||
return jsonify(result)
|
||||
|
||||
except Exception as e:
|
||||
print(f"DEBUG: Update route exception: {e}")
|
||||
return jsonify({'success': False, 'error': str(e)})
|
||||
|
||||
@warehouse_bp.route('/delete_location', methods=['POST'])
|
||||
@@ -2774,15 +2780,20 @@ def delete_location():
|
||||
from app.warehouse import delete_location_by_id
|
||||
try:
|
||||
data = request.get_json()
|
||||
print(f"DEBUG: Received delete request data: {data}")
|
||||
|
||||
location_id = data.get('location_id')
|
||||
print(f"DEBUG: Extracted location_id: {location_id} (type: {type(location_id)})")
|
||||
|
||||
if not location_id:
|
||||
return jsonify({'success': False, 'error': 'Location ID is required'})
|
||||
|
||||
result = delete_location_by_id(location_id)
|
||||
print(f"DEBUG: Delete result: {result}")
|
||||
return jsonify(result)
|
||||
|
||||
except Exception as e:
|
||||
print(f"DEBUG: Delete route exception: {e}")
|
||||
return jsonify({'success': False, 'error': str(e)})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user