Write cars to file
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user