aboutsummaryrefslogtreecommitdiff
path: root/api/internal/controllers/stats.go
diff options
context:
space:
mode:
authorZach Berwaldt <zberwaldt@tutamail.com>2024-03-07 19:56:34 -0500
committerZach Berwaldt <zberwaldt@tutamail.com>2024-03-07 19:56:34 -0500
commit29f83e05270d0012ad9f273ac3364106fcff5f50 (patch)
treec7b5df7cc21d6d2eb69950c57575a73bc598d809 /api/internal/controllers/stats.go
parent6651daca670664f3de8af9c7bcb74b1e7c6c6be9 (diff)
chore: Update paths in test and database configuration
This commit updates the paths in the test suite and database configuration to reflect the new directory structure. In the `api/cmd/main_test.go` file, the path for the config file is changed from `viper.SetConfigName(".env")` to `viper.SetConfigFile("../.env")` and `viper.AddConfigPath(".")` is added for configuration purposes. Additionally, `viper.AutomaticEnv()` is added to enable automatic environment variable configuration. In the same file, error handling is improved by adding explicit checks and error messages. The `api/internal/database/database.go` file is also modified, updating the path for database initialization from `"../db/water.sqlite3"` to `"../../db/water.sqlite3"`. These changes ensure proper configuration and functioning of the application.
Diffstat (limited to 'api/internal/controllers/stats.go')
-rw-r--r--api/internal/controllers/stats.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/internal/controllers/stats.go b/api/internal/controllers/stats.go
index 9808ace..d8ed434 100644
--- a/api/internal/controllers/stats.go
+++ b/api/internal/controllers/stats.go
@@ -4,8 +4,8 @@ import (
4 "database/sql" 4 "database/sql"
5 "github.com/gin-gonic/gin" 5 "github.com/gin-gonic/gin"
6 "net/http" 6 "net/http"
7 "water/api/database" 7 "water/api/internal/database"
8 "water/api/models" 8 "water/api/internal/models"
9) 9)
10 10
11func GetAllStatistics(c *gin.Context) { 11func GetAllStatistics(c *gin.Context) {