Save Markdowns
This commit is contained in:
@@ -40,7 +40,7 @@ def create_path():
|
||||
if not data or 'name' not in data or 'parent_id' not in data:
|
||||
return jsonify({"error": "bad request"}), 400
|
||||
with get_db() as session:
|
||||
if data['parent_id'] != 0 and not session.query(Path).get(data['parent_id']):
|
||||
if data['parent_id'] != 1 and not session.query(Path).get(data['parent_id']):
|
||||
return jsonify({"error": "path not found"}), 404
|
||||
if session.query(Path).filter_by(name=data['name'], parent_id=data['parent_id']).first():
|
||||
return jsonify({"error": "Path already exists under the parent"}), 409
|
||||
|
||||
Reference in New Issue
Block a user