diff --git a/internal/entity/sites.go b/internal/entity/sites.go index 9e5e883..465a492 100644 --- a/internal/entity/sites.go +++ b/internal/entity/sites.go @@ -29,8 +29,6 @@ type Site struct { Longitude *float64 `json:"longitude"` Region string `json:"region"` Regency string `json:"regency"` - Lat float64 `json:"lat"` - Long float64 `json:"long"` Distance float64 `gorm:"-"` } diff --git a/internal/handlers/http/sites/sites.go b/internal/handlers/http/sites/sites.go index 3045001..2b5ed3f 100644 --- a/internal/handlers/http/sites/sites.go +++ b/internal/handlers/http/sites/sites.go @@ -287,8 +287,8 @@ func (h *Handler) toSiteResponse(resp *entity.Site) response.Site { CreatedAt: resp.CreatedAt.Format(time.RFC3339), UpdatedAt: resp.UpdatedAt.Format(time.RFC3339), Products: h.toProductResponseList(resp.Products), - Lat: resp.Lat, - Long: resp.Long, + Lat: *resp.Latitude, + Long: *resp.Longitude, } } diff --git a/internal/handlers/request/site.go b/internal/handlers/request/site.go index 59d0470..25b9cb5 100644 --- a/internal/handlers/request/site.go +++ b/internal/handlers/request/site.go @@ -62,8 +62,8 @@ func (r *Site) ToEntity(createdBy int64) *entity.Site { Products: products, Region: r.Region, Regency: r.Regency, - Lat: r.Lat, - Long: r.Long, + Latitude: &r.Lat, + Longitude: &r.Long, } } diff --git a/k8s/staging/deployment.yaml b/k8s/staging/deployment.yaml index 792a7f4..eb96321 100644 --- a/k8s/staging/deployment.yaml +++ b/k8s/staging/deployment.yaml @@ -16,7 +16,7 @@ spec: serviceAccountName: custom-serviceaccount containers: - name: furtuna-backend - image: registry.gitlab.com/altru.id/furtuna/furtuna-backend: + image: registry.gitlab.com/altru.id/furtuna/furtuna-backend:f2029ab5-dev ports: - containerPort: 3300 volumeMounts: diff --git a/k8s/staging/ingress-cors.yaml b/k8s/staging/ingress-cors.yaml index 7925d49..4712135 100644 --- a/k8s/staging/ingress-cors.yaml +++ b/k8s/staging/ingress-cors.yaml @@ -9,7 +9,7 @@ metadata: nginx.ingress.kubernetes.io/ingress-class: "nginx" nginx.ingress.kubernetes.io/enable-cors: "true" nginx.ingress.kubernetes.io/cors-allow-origin: "*" - nginx.ingress.kubernetes.io/cors-allow-methods: "GET, POST, PUT, OPTIONS" + nginx.ingress.kubernetes.io/cors-allow-methods: "GET, POST, PUT, DELETE, OPTIONS" nginx.ingress.kubernetes.io/cors-allow-headers: "Content-Type, Authorization, x-access-token" nginx.ingress.kubernetes.io/cors-allow-credentials: "true" spec: