File tree Expand file tree Collapse file tree
components/payments/cmd/connectors/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313 "github.com/formancehq/payments/internal/otel"
1414 "github.com/formancehq/stack/libs/go-libs/api"
1515 "github.com/formancehq/stack/libs/go-libs/bun/bunpaginate"
16- "github.com/formancehq/stack/libs/go-libs/logging"
1716 "github.com/formancehq/stack/libs/go-libs/pointer"
1817 "github.com/google/uuid"
1918 "github.com/gorilla/mux"
@@ -132,24 +131,6 @@ func readConfig[Config models.ConnectorConfigObject](
132131 caser := cases .Title (language .English )
133132 m ["provider" ] = caser .String (connectorID .Provider .String ())
134133
135- // rewrite pollingDuration struct as a string to match API spec
136- pollingPeriod , ok := m ["pollingPeriod" ].(map [string ]interface {})
137- if ok {
138- duration , found := pollingPeriod ["duration" ]
139- if found {
140- var ns int64
141- switch v := duration .(type ) {
142- case int64 :
143- ns = v
144- case float64 :
145- ns = int64 (v )
146- default :
147- logging .FromContext (ctx ).Debugf ("pollingPeriod.Duration was of an unexpected type: %T" , v )
148- }
149- m ["pollingPeriod" ] = time .Duration (ns ).String ()
150- }
151- }
152-
153134 result , err := json .Marshal (m )
154135 if err != nil {
155136 otel .RecordError (span , err )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type Duration struct {
1010 time.Duration `json:"duration"`
1111}
1212
13- func (d * Duration ) MarshalJSON () ([]byte , error ) {
13+ func (d Duration ) MarshalJSON () ([]byte , error ) {
1414 return json .Marshal (d .Duration .String ())
1515}
1616
You can’t perform that action at this time.
0 commit comments