Skip to content

Commit

Permalink
Merge pull request #913 from jackchenjc/issue-908-4
Browse files Browse the repository at this point in the history
fix: Add missing field "Method" to model and DTO transform functions
  • Loading branch information
cloudxxx8 authored Aug 6, 2024
2 parents 108bb03 + 2e1836e commit e25b965
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dtos/schedulejob.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func ToScheduleActionModel(dto ScheduleAction) models.ScheduleAction {
ContentType: dto.ContentType,
Payload: dto.Payload,
},
Method: dto.Method,
Address: dto.Address,
InjectEdgeXAuth: dto.InjectEdgeXAuth,
}
Expand Down Expand Up @@ -271,6 +272,7 @@ func FromScheduleActionModelToDTO(model models.ScheduleAction) ScheduleAction {
Payload: restModel.Payload,
RESTAction: RESTAction{
Address: restModel.Address,
Method: restModel.Method,
InjectEdgeXAuth: restModel.InjectEdgeXAuth,
},
}
Expand Down
3 changes: 3 additions & 0 deletions dtos/schedulejob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package dtos

import (
"net/http"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -45,6 +46,7 @@ var scheduleActionRest = ScheduleAction{
Payload: []byte(payload),
RESTAction: RESTAction{
Address: testPath,
Method: http.MethodGet,
},
}

Expand All @@ -55,6 +57,7 @@ var scheduleActionRestModel = models.RESTAction{
Payload: []byte(payload),
},
Address: testPath,
Method: http.MethodGet,
}

var scheduleActionDeviceControl = ScheduleAction{
Expand Down

0 comments on commit e25b965

Please sign in to comment.