Got it working!

This commit is contained in:
Daniel Ledda
2020-11-03 00:10:34 +01:00
parent bbecf46531
commit faaff37b2a

View File

@@ -47,7 +47,7 @@ func saveSnapshot(w http.ResponseWriter, r *http.Request) error {
if err != nil { if err != nil {
return fmt.Errorf("couldn't create snapshot from JSON: %w", err) return fmt.Errorf("couldn't create snapshot from JSON: %w", err)
} }
query := fmt.Sprintf("INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, `%v`, NULL);", query := fmt.Sprintf("INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, %v, NULL);",
snapshotSub.Temp, snapshotSub.Temp,
snapshotSub.Humidity, snapshotSub.Humidity,
snapshotSub.Co2, snapshotSub.Co2,