{
    "sourceFile": "src/lib.rs",
    "activeCommit": 0,
    "commits": [
        {
            "activePatchIndex": 0,
            "patches": [
                {
                    "date": 1763769761343,
                    "content": "Index: \n===================================================================\n--- \n+++ \n"
                }
            ],
            "date": 1763769761343,
            "name": "Commit-0",
            "content": "use serde_json::Value;\nuse reqwest::Client;\n\n/// ส่ง JSON POST ไปยัง PHP แล้วรับ JSON กลับมา\npub async fn ajax_post(url: &str, data: &Value) -> Result<Value, String> {\n    let client = Client::new();\n\n    let res = client\n        .post(url)\n        .json(data)\n        .send()\n        .await\n        .map_err(|e| format!(\"HTTP Error: {}\", e))?;\n\n    let status = res.status().as_u16();\n\n    if status != 200 {\n        return Err(format!(\"Server returned HTTP {}\", status));\n    }\n\n    let json = res\n        .json::<Value>()\n        .await\n        .map_err(|e| format!(\"JSON Parse Error: {}\", e))?;\n\n    Ok(json)\n}\n"
        }
    ]
}