Skip to content

Commit 0a6cea1

Browse files
committed
Remove location on error
1 parent 061f43a commit 0a6cea1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

internal/events/conversion.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package events
22

33
import (
44
"context"
5-
"fmt"
65

76
"github.com/joinimpact/api/internal/models"
87
"github.com/joinimpact/api/pkg/location"
@@ -65,12 +64,12 @@ func (s *service) eventToView(event models.Event) (*EventView, error) {
6564
Longitude: event.LocationLongitude,
6665
Latitude: event.LocationLatitude,
6766
})
68-
if err != nil {
69-
fmt.Println(location, err)
70-
return nil, NewErrServerError()
67+
if err == nil {
68+
view.Location = location
69+
} else {
70+
s.logger.Error().Err(err).Msg("Error getting event location")
7171
}
7272

73-
view.Location = location
7473
}
7574

7675
view.EventSchedule = &EventSchedule{}

server

-96 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)