Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/api/prompts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Prompts Routes"""

from .prompts import router as prompts_router
18 changes: 18 additions & 0 deletions app/api/prompts/prompts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

from app import __version__
import os
from app.utils.make_meta import make_meta
from fastapi import APIRouter, Query, Path
from app.utils.db import get_db_connection

router = APIRouter()
base_url = os.getenv("BASE_URL", "http://localhost:8000")

@router.get("/prompts")
def root() -> dict:
"""GET /prospects endpoint."""
meta = make_meta("success", "Prompts endpoint")
data = [
{"init": f"{base_url}/prompts"},
]
return {"meta": meta, "data": data}
6 changes: 3 additions & 3 deletions app/api/prospects/prospects.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ def slugify(text):
data = {
"total": total,
"groups": {
"level": {
"seniority": {
"total": total_unique_seniority,
"list": seniority
},
"job": {
"title": {
"total": total_unique_title,
"list": title
},
"lane": {
"sub_departments": {
"total": total_unique_sub_departments,
"list": sub_departments
}
Expand Down
1 change: 1 addition & 0 deletions app/api/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def root() -> dict:
endpoints = [
{"name": "docs", "url": f"{base_url}/docs"},
{"name": "health", "url": f"{base_url}/health"},
{"name": "prompts", "url": f"{base_url}/prompts"},
{"name": "prospects", "url": f"{base_url}/prospects"},
]
return {"meta": meta, "data": endpoints}
4 changes: 2 additions & 2 deletions app/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

from app.api.root import router as root_router
from app.api.health import router as health_router


from app.api.prompts.prompts import router as prompts_router
from app.api.prospects.prospects import router as prospects_router
from app.api.prospects.database.alter import router as prospects_alter_router
from app.api.prospects.database.seed import router as prospects_seed_router
Expand All @@ -22,6 +21,7 @@

router.include_router(root_router)
router.include_router(health_router)
router.include_router(prompts_router)
router.include_router(prospects_router)
router.include_router(prospects_alter_router)
router.include_router(prospects_seed_router)
Expand Down
Loading