Skip to content

Commit

Permalink
fix: remove validation if lat and long is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
choffmann committed Feb 26, 2025
1 parent 94d7b8c commit bad0d53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/storage/postgres/sensor/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ func (r *SensorRepository) validateSensorEntity(sensor *entities.Sensor) error {
if sensor.ID == "" {
return errors.New("sensor id cannot be empty")
}
if sensor.Latitude < -90 || sensor.Latitude > 90 || sensor.Latitude == 0 {
if sensor.Latitude < -90 || sensor.Latitude > 90 {
return storage.ErrInvalidLatitude
}
if sensor.Longitude < -180 || sensor.Longitude > 180 || sensor.Longitude == 0 {
if sensor.Longitude < -180 || sensor.Longitude > 180 {
return storage.ErrInvalidLongitude
}

Expand Down

0 comments on commit bad0d53

Please sign in to comment.