@@ -46,21 +46,23 @@ type ServiceResponse struct {
4646}
4747
4848func queryPagerdutyRemoteScopes (
49- connection * models.PagerDutyConnection ,
5049 apiClient plugin.ApiClient ,
51- groupId string ,
50+ _ string ,
5251 page PagerdutyRemotePagination ,
5352 search string ,
5453) (
5554 children []dsmodels.DsRemoteApiScopeListEntry [models.Service ],
5655 nextPage * PagerdutyRemotePagination ,
5756 err errors.Error ,
5857) {
58+ if page .Limit == 0 {
59+ page .Limit = 50
60+ }
5961 var res * http.Response
6062 res , err = apiClient .Get ("/services" , url.Values {
6163 "offset" : {strconv .Itoa (page .Offset )},
6264 "limit" : {strconv .Itoa (page .Limit )},
63- "search" : {search },
65+ "query" : {search },
6466 }, nil )
6567 if err != nil {
6668 return
@@ -85,7 +87,6 @@ func queryPagerdutyRemoteScopes(
8587 NoPKModel : common.NoPKModel {
8688 CreatedAt : service .CreatedAt ,
8789 },
88- ConnectionId : connection .ID ,
8990 },
9091 },
9192 })
@@ -112,7 +113,7 @@ func listPagerdutyRemoteScopes(
112113 * PagerdutyRemotePagination ,
113114 errors.Error ,
114115) {
115- return queryPagerdutyRemoteScopes (connection , apiClient , groupId , page , "" )
116+ return queryPagerdutyRemoteScopes (apiClient , groupId , page , "" )
116117}
117118
118119func searchPagerdutyRemoteScopes (
@@ -122,7 +123,7 @@ func searchPagerdutyRemoteScopes(
122123 children []dsmodels.DsRemoteApiScopeListEntry [models.Service ],
123124 err errors.Error ,
124125) {
125- children , _ , err = queryPagerdutyRemoteScopes (nil , apiClient , "" , PagerdutyRemotePagination {
126+ children , _ , err = queryPagerdutyRemoteScopes (apiClient , "" , PagerdutyRemotePagination {
126127 Offset : (params .Page - 1 ) * params .PageSize ,
127128 Limit : params .PageSize ,
128129 }, params .Search )
0 commit comments