File size: 671 Bytes
6a8626d
 
 
 
 
 
 
dd4fff8
6a8626d
6e73939
2646146
6e73939
 
dd4fff8
6e73939
 
 
 
 
 
 
 
dd4fff8
6e73939
 
 
3aa45c9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
Defines Flask routes for handling call by category

This module contains API endpoints for managing and retrieving categories
from the MongoDB database. 

Routes:
    - GET /category: Fetch all categories.
"""
from flask import jsonify
from ..controllers.category import get_categories
from . import category_bp

@category_bp.route("/category", methods=["GET"])
def fetch_categories():
    """
    Handles GET requests to retrieve all categories.

    Returns:
        list[dict]: JSON response containing categories and their associated sites.

    Endpoint:
        GET /category

    """
    category_data = get_categories()
    return jsonify(category_data), 200