Update main.py
Browse files
main.py
CHANGED
|
@@ -825,3 +825,26 @@ def get_home():
|
|
| 825 |
|
| 826 |
# fallback ูู ู
ุด ู
ูุฌูุฏ message
|
| 827 |
return {"message": "Home Fetched Successfully", "data": data}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 825 |
|
| 826 |
# fallback ูู ู
ุด ู
ูุฌูุฏ message
|
| 827 |
return {"message": "Home Fetched Successfully", "data": data}
|
| 828 |
+
|
| 829 |
+
# ====== About Us ======
|
| 830 |
+
|
| 831 |
+
@app.get("/api/about")
|
| 832 |
+
def get_about():
|
| 833 |
+
"""
|
| 834 |
+
ูุฑุฌูุน ุจูุงูุงุช ุตูุญุฉ 'ู
ู ูุญู' ู
ู ู
ูู aboutus.json
|
| 835 |
+
"""
|
| 836 |
+
path = BASE_DIR / "aboutus.json"
|
| 837 |
+
if not path.exists():
|
| 838 |
+
raise HTTPException(500, "aboutus.json not found")
|
| 839 |
+
|
| 840 |
+
try:
|
| 841 |
+
data = json.loads(path.read_text(encoding="utf-8"))
|
| 842 |
+
except json.JSONDecodeError:
|
| 843 |
+
raise HTTPException(500, "aboutus.json contains invalid JSON")
|
| 844 |
+
|
| 845 |
+
# ูู ุงูู
ูู ููู message + data ุฒู ุจุงูู ุงูู
ููุงุช
|
| 846 |
+
if isinstance(data, dict) and "data" in data:
|
| 847 |
+
return data
|
| 848 |
+
|
| 849 |
+
# fallback ุจุณูุท ูู ุงูู
ูู ุนุจุงุฑุฉ ุนู ูุงุฆู ูุงุญุฏ
|
| 850 |
+
return {"message": "About Fetched Successfully", "data": data}
|