aboutsummaryrefslogtreecommitdiff
path: root/internal/webui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/webui/root_test.go4
-rw-r--r--internal/webui/webui.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/webui/root_test.go b/internal/webui/root_test.go
index 945f04b..b86bb1c 100644
--- a/internal/webui/root_test.go
+++ b/internal/webui/root_test.go
@@ -12,7 +12,7 @@ import (
type NavitiaMockClient struct {
departures []model.Departure
- trainStops []model.TrainStop
+ trainStops []model.Stop
err error
}
@@ -20,7 +20,7 @@ func (c *NavitiaMockClient) GetDepartures(trainStop string) (departures []model.
return c.departures, c.err
}
-func (c *NavitiaMockClient) GetTrainStops() (trainStops []model.TrainStop, err error) {
+func (c *NavitiaMockClient) GetStops() (trainStops []model.Stop, err error) {
return c.trainStops, c.err
}
diff --git a/internal/webui/webui.go b/internal/webui/webui.go
index 1a251f4..fa59f68 100644
--- a/internal/webui/webui.go
+++ b/internal/webui/webui.go
@@ -19,11 +19,11 @@ func Run(c *config.Config, dbEnv *database.DBEnv) {
http.Handle("/login", handler{&e, loginHandler})
http.Handle("/static/", http.FileServer(http.FS(staticFS)))
- if i, err := dbEnv.CountTrainStops(); err == nil && i == 0 {
+ if i, err := dbEnv.CountStops(); err == nil && i == 0 {
log.Printf("No trains stops data found, updating...")
- if trainStops, err := e.navitia.GetTrainStops(); err == nil {
+ if trainStops, err := e.navitia.GetStops(); err == nil {
log.Printf("Updated trains stops data from navitia api, got %d results", len(trainStops))
- if err = dbEnv.ReplaceAndImportTrainStops(trainStops); err != nil {
+ if err = dbEnv.ReplaceAndImportStops(trainStops); err != nil {
if dberr, ok := err.(*database.QueryError); ok {
log.Printf("%+v", dberr.Unwrap())
}