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

This commit is contained in:
Admin 2026-05-15 16:06:33 +07:00
parent 8ad0ba9c25
commit 2675a60ffc
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)