diff --git a/angular/src/app/services/data.service.ts b/angular/src/app/services/data.service.ts index f6665a3..438ad0f 100644 --- a/angular/src/app/services/data.service.ts +++ b/angular/src/app/services/data.service.ts @@ -12,6 +12,9 @@ export class DataService { public list(p: DataParams): Observable { let params = new HttpParams(); + + params = params.append('response_type', 'list'); + if (p.start !== undefined) { params = params.append('start', p.start.toString()); } @@ -92,6 +95,8 @@ export class DataService { public find(p: DataParams): Observable { let params = new HttpParams(); + params = params.append('response_type', 'one'); + // if if (p.idQuery !== undefined) { params = params.append('id', '1'); @@ -162,7 +167,8 @@ export class DataService { } } - return this.http.get(this.rootURL + '1', {params: params}); + + return this.http.get(this.rootURL, {params: params}); } public create(m: Data) { diff --git a/api/handler/data.go b/api/handler/data.go index 657c8c8..1d85dce 100644 --- a/api/handler/data.go +++ b/api/handler/data.go @@ -85,6 +85,7 @@ func (h *Handler) ListData(cx *gin.Context) { p.LocationQuery.Options = cx.Query("location.options") } + // int64 if age == "1" { p.Age = true p.AgeQuery = repo.DataAgeQuery{} @@ -104,6 +105,7 @@ func (h *Handler) ListData(cx *gin.Context) { p.AgeQuery.To = to } + // float64 if price == "1" { p.Price = true p.PriceQuery = repo.DataPriceQuery{} @@ -121,6 +123,7 @@ func (h *Handler) ListData(cx *gin.Context) { p.PriceQuery.To = to } + // bool if enabled == "1" { p.Enabled = true p.EnabledQuery = repo.DataEnabledQuery{}