ชื่อ API: updateCustomer

--- ### 📘 รายละเอียด API **Method:** `POST` **Endpoint:** `http://127.0.0.1/w6/updateCustomer.php` --- ### 📩 Request Body (JSON) | Parameter | Type | Description | | ------------- | ------ | --------------------------------------- | | cus_id | string | รหัสลูกค้าที่ต้องการอัปเดต | | cus_name | string | ชื่อลูกค้าใหม่ | | cus_username | string | ชื่อผู้ใช้ใหม่ (username) | | cus_password | string | รหัสผ่านใหม่ | --- ### 🧠 ตัวอย่าง Request ```json { "cus_id": "CUS01", "cus_name": "Supawat Boondee", "cus_username": "supawat@rmuti.ac.th", "cus_password": "8888" } ``` --- ### ✅ ตัวอย่าง Response (สำเร็จ) ```json { "result": 1, "message": "Customer updated successfully" } ``` --- ### ⚠️ ตัวอย่าง Response (ไม่พบข้อมูล) ```json { "result": 0, "message": "No changes or customer not found" } ``` --- ### ❌ ตัวอย่าง Response (Error) ```json { "error": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'shop.customers' doesn't exist" } ``` --- ### 🔢 HTTP Codes | Code | Message | | ---- | ----------------------- | | 200 | OK | | 400 | Bad Request | | 404 | Not Found | | 500 | Internal Server Error | --- ### 📄 คำอธิบาย API นี้ใช้สำหรับอัปเดตข้อมูลลูกค้าบางส่วน โดยระบุรหัสลูกค้า (`cus_id`) สามารถแก้ไขชื่อผู้ใช้หรือรหัสผ่านได้ ระบบจะบันทึก log การเปลี่ยนแปลงด้วย