| """ | |
| Category Controller - Business logic for handling category data. | |
| This module contains functions that interact with the database | |
| to fetch and process data sorted by category | |
| """ | |
| from models.database import category_collection # pylint: disable=import-error | |
| def get_categories(): | |
| """ | |
| Returns all categories and their corresponding sites | |
| """ | |
| categories = list(category_collection.find({}, {"_id": 0, "category": 1, "site": 1})) | |
| return categories | |