upgrade react-query to v5
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
from flask import jsonify, request
|
||||
from flask.sansio.blueprints import Blueprint
|
||||
|
||||
from api import etag_response, require_auth
|
||||
from api.template import template_bp
|
||||
from db import get_db
|
||||
from db.models.PathTemplate import PathTemplate
|
||||
|
||||
|
||||
@template_bp.route('/path/<int:template_id>', methods=['GET'])
|
||||
path_template_bp = Blueprint('path_template', __name__, url_prefix='/api/template/path')
|
||||
@path_template_bp.route('/<int:template_id>', methods=['GET'])
|
||||
@etag_response
|
||||
def get_path_template(template_id):
|
||||
"""
|
||||
@@ -30,7 +31,7 @@ def get_path_template(template_id):
|
||||
return jsonify({}), 204
|
||||
return jsonify(template.to_dict()), 200
|
||||
|
||||
@template_bp.route('/path/', methods=['GET'])
|
||||
@path_template_bp.route('/', methods=['GET'])
|
||||
@etag_response
|
||||
def get_path_templates():
|
||||
"""
|
||||
@@ -49,7 +50,7 @@ def get_path_templates():
|
||||
return jsonify([template.to_dict() for template in templates]), 200
|
||||
|
||||
|
||||
@template_bp.route('/path/', methods=['POST'])
|
||||
@path_template_bp.route('/', methods=['POST'])
|
||||
@require_auth(roles=['admin'])
|
||||
def create_path_template():
|
||||
"""
|
||||
@@ -84,7 +85,7 @@ def create_path_template():
|
||||
return jsonify({"error": "failed to create path template"}), 400
|
||||
|
||||
|
||||
@template_bp.route('/path/<int:template_id>', methods=['PUT', 'PATCH'])
|
||||
@path_template_bp.route('/<int:template_id>', methods=['PUT', 'PATCH'])
|
||||
@require_auth(roles=['admin'])
|
||||
def update_path_template(template_id):
|
||||
"""
|
||||
@@ -118,7 +119,7 @@ def update_path_template(template_id):
|
||||
return jsonify(template.to_dict()), 200
|
||||
|
||||
|
||||
@template_bp.route('/path/<int:template_id>', methods=['DELETE'])
|
||||
@path_template_bp.route('/<int:template_id>', methods=['DELETE'])
|
||||
@require_auth(roles=['admin'])
|
||||
def delete_path_template(template_id):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user