upgrade react-query to v5
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
from flask import jsonify, request
|
||||
from flask import jsonify, request, Blueprint
|
||||
|
||||
import api
|
||||
from api import limiter, require_auth, etag_response
|
||||
from api.setting import setting_bp
|
||||
from db import get_db
|
||||
from db.models.PathSetting import PathSetting
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@setting_bp.route('/path/<int:setting_id>', methods=['GET'])
|
||||
path_setting_bp = Blueprint('path_setting', __name__, url_prefix='/api/setting/path')
|
||||
|
||||
@path_setting_bp.route('/<int:setting_id>', methods=['GET'])
|
||||
@limiter.limit(api.get_rate_limit)
|
||||
@etag_response
|
||||
def get_path_setting(setting_id):
|
||||
@@ -34,7 +35,7 @@ def get_path_setting(setting_id):
|
||||
return jsonify({}), 204
|
||||
return jsonify(setting.to_dict()), 200
|
||||
|
||||
@setting_bp.route('/path/', methods=['POST'])
|
||||
@path_setting_bp.route('/', methods=['POST'])
|
||||
@require_auth(roles=['admin'])
|
||||
def create_path_setting():
|
||||
"""
|
||||
@@ -71,7 +72,7 @@ def create_path_setting():
|
||||
return jsonify({"error": "failed to create setting"}), 500
|
||||
|
||||
|
||||
@setting_bp.route('/path/<int:setting_id>', methods=['PUT', 'PATCH'])
|
||||
@path_setting_bp.route('/<int:setting_id>', methods=['PUT', 'PATCH'])
|
||||
@require_auth(roles=['admin'])
|
||||
def update_path_setting(setting_id):
|
||||
"""
|
||||
@@ -108,7 +109,7 @@ def update_path_setting(setting_id):
|
||||
except Exception:
|
||||
return jsonify({"error": "failed to update path setting"}), 500
|
||||
|
||||
@setting_bp.route('/path/<int:setting_id>', methods=['DELETE'])
|
||||
@path_setting_bp.route('/<int:setting_id>', methods=['DELETE'])
|
||||
@require_auth(roles=['admin'])
|
||||
def delete_path_setting(setting_id):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user