Skip to content

Commit 5c8aefc

Browse files
authored
fixes issue with agent parameters. (#386)
1 parent 1648116 commit 5c8aefc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pkg/handlers/send_odp_event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SendOdpEvent(w http.ResponseWriter, r *http.Request) {
4242
return
4343
}
4444

45-
err = optlyClient.SendOdpEvent(body.Action, body.Type, body.Identifiers, body.Data)
45+
err = optlyClient.SendOdpEvent(body.Type, body.Action, body.Identifiers, body.Data)
4646
if err != nil {
4747
RenderError(err, http.StatusInternalServerError, w, r)
4848
return

pkg/handlers/send_odp_event_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ func (suite *SendOdpEventTestSuite) assertError(rec *httptest.ResponseRecorder,
134134

135135
func (suite *SendOdpEventTestSuite) TestSendOdpEvent() {
136136
sb := event.Event{
137-
Action: "any",
138-
Type: "any",
137+
Action: "1",
138+
Type: "2",
139139
Identifiers: map[string]string{"fs-user-id": "test-user", "email": "[email protected]"},
140140
Data: nil,
141141
}
@@ -164,8 +164,8 @@ func (suite *SendOdpEventTestSuite) TestSendOdpEvent() {
164164
suite.Equal(1, len(events))
165165

166166
actualEvent := events[0]
167-
suite.Equal("any", actualEvent.Action)
168-
suite.Equal("any", actualEvent.Type)
167+
suite.Equal("1", actualEvent.Action)
168+
suite.Equal("2", actualEvent.Type)
169169
suite.Equal(map[string]string{"email": "[email protected]", "fs_user_id": "test-user"}, actualEvent.Identifiers)
170170
suite.Equal("go-sdk", actualEvent.Data["data_source"])
171171
suite.Equal("sdk", actualEvent.Data["data_source_type"])
@@ -177,7 +177,7 @@ func (suite *SendOdpEventTestSuite) TestSendOdpEvent() {
177177

178178
func (suite *SendOdpEventTestSuite) TestSendOdpEventMissingAction() {
179179
db := event.Event{
180-
Type: "any",
180+
Type: "1",
181181
Identifiers: map[string]string{"fs-user-id": "testUser", "email": "[email protected]"},
182182
Data: nil,
183183
}
@@ -196,7 +196,7 @@ func (suite *SendOdpEventTestSuite) TestSendOdpEventMissingAction() {
196196
func (suite *SendOdpEventTestSuite) TestSendOdpEventEmptyAction() {
197197
db := event.Event{
198198
Action: "",
199-
Type: "any",
199+
Type: "1",
200200
Identifiers: map[string]string{"fs-user-id": "testUser", "email": "[email protected]"},
201201
Data: nil,
202202
}
@@ -214,8 +214,8 @@ func (suite *SendOdpEventTestSuite) TestSendOdpEventEmptyAction() {
214214

215215
func (suite *SendOdpEventTestSuite) TestSendOdpEventMissingIdentifiers() {
216216
db := event.Event{
217-
Action: "any",
218-
Type: "any",
217+
Action: "1",
218+
Type: "2",
219219
Data: nil,
220220
}
221221

@@ -232,8 +232,8 @@ func (suite *SendOdpEventTestSuite) TestSendOdpEventMissingIdentifiers() {
232232

233233
func (suite *SendOdpEventTestSuite) TestSendOdpEventEmptyIdentifiers() {
234234
db := event.Event{
235-
Action: "any",
236-
Type: "any",
235+
Action: "1",
236+
Type: "2",
237237
Identifiers: map[string]string{},
238238
Data: nil,
239239
}

0 commit comments

Comments
 (0)