Changed endpoints and db queries, chart now shows suggested mins and maxes
This commit is contained in:
@@ -27,7 +27,7 @@ func CloseDb() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func writeSnapshotToDb(snapshotSub *SnapshotSubmission) (int64, error) {
|
func writeSnapshotToDb(snapshotSub *SnapshotSubmission) (int64, error) {
|
||||||
queryStr := "INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (%v, %v, %v, '%v', NULL);"
|
queryStr := "INSERT INTO `snapshots` (`temp`, `humidity`, `co2`, `time`, `id`) VALUES (?, ?, ?, '?', NULL);"
|
||||||
query, err := ClimateDb.Prepare(queryStr)
|
query, err := ClimateDb.Prepare(queryStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1, fmt.Errorf("couldn't prepare snapshot query: %w", err)
|
return -1, fmt.Errorf("couldn't prepare snapshot query: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user