From da64a180a2c3b58cbb087a3b40cb8575432aa673 Mon Sep 17 00:00:00 2001 From: Dylan Trotter Date: Thu, 23 Dec 2021 12:33:12 -0500 Subject: [PATCH] Make WithSort arg field names public (#10) --- get-records.go | 8 ++++---- get-records_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/get-records.go b/get-records.go index 075486e..b0bc7e6 100644 --- a/get-records.go +++ b/get-records.go @@ -42,12 +42,12 @@ func (grc *GetRecordsConfig) WithFilterFormula(filterFormula string) *GetRecords // WithSort add sorting to request. func (grc *GetRecordsConfig) WithSort(sortQueries ...struct { - fieldName string - direction string + FieldName string + Direction string }) *GetRecordsConfig { for queryNum, sortQuery := range sortQueries { - grc.params.Set(fmt.Sprintf("sort[%v][field]", queryNum), sortQuery.fieldName) - grc.params.Set(fmt.Sprintf("sort[%v][direction]", queryNum), sortQuery.direction) + grc.params.Set(fmt.Sprintf("sort[%v][field]", queryNum), sortQuery.FieldName) + grc.params.Set(fmt.Sprintf("sort[%v][direction]", queryNum), sortQuery.Direction) } return grc } diff --git a/get-records_test.go b/get-records_test.go index d001e1e..7de2fd7 100644 --- a/get-records_test.go +++ b/get-records_test.go @@ -13,12 +13,12 @@ func TestGetRecordsConfig_Do(t *testing.T) { table := testTable(t) table.client.baseURL = mockResponse("get_records_with_filter.json").URL sortQuery1 := struct { - fieldName string - direction string + FieldName string + Direction string }{"Field1", "desc"} sortQuery2 := struct { - fieldName string - direction string + FieldName string + Direction string }{"Field2", "asc"} records, err := table.GetRecords().