Binrushd-Medical-Center commited on
Commit
af0c36d
ยท
verified ยท
1 Parent(s): 307f42f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +23 -0
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}