docs
Some checks failed
Deploy MkDocs / deploy (push) Has been cancelled
Code checks / check-url-paths (push) Has been cancelled
docker / docker_dev (push) Has been cancelled

This commit is contained in:
jokob-sk
2025-08-24 13:12:33 +10:00
parent 3227cbbfa4
commit 40e9fbdb3f
5 changed files with 233 additions and 57 deletions

View File

@@ -29,31 +29,4 @@ Manage the **online history records** of devices. Currently, the API supports de
```bash
curl -X DELETE "http://<server_ip>:<GRAPHQL_PORT>/history" \
-H "Authorization: Bearer <API_TOKEN>"
```
---
### Implementation Details
The endpoint calls the helper function `delete_online_history()`:
```python
def delete_online_history():
"""Delete all online history activity"""
conn = get_temp_db_connection()
cur = conn.cursor()
# Remove all entries from Online_History table
cur.execute("DELETE FROM Online_History")
conn.commit()
conn.close()
return jsonify({"success": True, "message": "Deleted online history"})
```
* Opens a temporary database connection for the request.
* Executes a **full table delete** (`DELETE FROM Online_History`).
* Commits the transaction and closes the connection.
* Returns a JSON confirmation message.
```