update(server): connect api to erp and add func remove user #164

Merged
zelda merged 1 commits from zelda.checkin-for-au into master 2026-05-15 19:06:49 +10:00
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ from dotenv import load_dotenv
load_dotenv()
HOST = os.getenv("MS_HOST", "http://10.20.2.26:3002")
AUTH_TOKEN = os.getenv("MS_AUTH_TOKEN", "")
@ -30,9 +31,10 @@ def sync_checkin(email: str, timestamp_ms: int, image_data: bytes, student_name:
"image": image_b64,
}
headers = {"Authorization": f"Bearer {AUTH_TOKEN}"}
print("[sync_checkin] payload:", {k: v for k, v in payload.items() if k != "image"})
try:
response = requests.post(HOST + "/api/log-time/check-in-out", json=payload)
response = requests.post(HOST + "/api/log-time/check-in-out", json=payload, headers=headers)
response.raise_for_status()
res = response.json()
print("[sync_checkin] response:", res)