Changed endpoints and db queries, chart now shows suggested mins and maxes

This commit is contained in:
Daniel Ledda
2020-11-07 15:19:32 +01:00
parent bb855aaa9b
commit 89d1bfe6ba

View File

@@ -27,7 +27,7 @@ func CloseDb() {
}
func writeSnapshotToDb(snapshotSub *SnapshotSubmission) (int64, error) {
queryStr := "INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (?, ?, ?, '?', NULL);"
queryStr := "INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (?, ?, ?, ?, NULL);"
query, err := ClimateDb.Prepare(queryStr)
if err != nil {
return -1, fmt.Errorf("couldn't prepare snapshot query: %w", err)