Write cars to file

This commit is contained in:
SemvdH
2025-11-17 23:55:02 +01:00
parent 8d57f3fe33
commit 12f1adccf2
2 changed files with 63 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import json
import dbus
from urllib.parse import parse_qs
from ac_maps import change_track, get_all_tracks, get_configs, get_preview_image, get_outline_image
from ac_cars import get_all_cars, get_car_image
from ac_cars import get_all_cars, get_car_image, update_cars
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
@@ -166,6 +166,7 @@ class Handler(BaseHTTPRequestHandler):
import json
try:
data = json.loads(body)
success, message = update_cars(data.get("cars", []))
except json.JSONDecodeError:
self.send_response(400)
self.send_header("Content-Type", "application/json")