support
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
from flask import Blueprint, jsonify
|
||||
from flask import Blueprint, jsonify, request
|
||||
from flask_login import login_required, current_user
|
||||
from models import db, Room, RoomFile, User, DocuPulseSettings
|
||||
from models import db, Room, RoomFile, User, DocuPulseSettings, HelpArticle
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
@@ -253,9 +253,9 @@ def get_usage_stats():
|
||||
stats = DocuPulseSettings.get_usage_stats()
|
||||
return jsonify(stats)
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@admin.route('/help-articles/<int:article_id>', methods=['PUT'])
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@admin.route('/api/admin/help-articles/<int:article_id>', methods=['PUT'])
|
||||
@login_required
|
||||
def update_help_article(article_id):
|
||||
"""Update a help article"""
|
||||
@@ -307,7 +307,7 @@ def update_help_article(article_id):
|
||||
db.session.rollback()
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@admin.route('/help-articles/<int:article_id>', methods=['DELETE'])
|
||||
@admin.route('/api/admin/help-articles/<int:article_id>', methods=['DELETE'])
|
||||
@login_required
|
||||
def delete_help_article(article_id):
|
||||
"""Delete a help article"""
|
||||
@@ -339,7 +339,7 @@ def delete_help_article(article_id):
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
# Help Articles API endpoints
|
||||
@admin.route('/help-articles', methods=['GET'])
|
||||
@admin.route('/api/admin/help-articles', methods=['GET'])
|
||||
@login_required
|
||||
def get_help_articles():
|
||||
"""Get all help articles"""
|
||||
@@ -364,7 +364,7 @@ def get_help_articles():
|
||||
|
||||
return jsonify({'articles': articles_data})
|
||||
|
||||
@admin.route('/help-articles', methods=['POST'])
|
||||
@admin.route('/api/admin/help-articles', methods=['POST'])
|
||||
@login_required
|
||||
def create_help_article():
|
||||
"""Create a new help article"""
|
||||
@@ -417,7 +417,7 @@ def create_help_article():
|
||||
db.session.rollback()
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@admin.route('/help-articles/<int:article_id>', methods=['GET'])
|
||||
@admin.route('/api/admin/help-articles/<int:article_id>', methods=['GET'])
|
||||
@login_required
|
||||
def get_help_article(article_id):
|
||||
"""Get a specific help article"""
|
||||
|
||||
Reference in New Issue
Block a user