@@ -27,7 +27,7 @@ import UnisonShare.DefinitionDiff as DefinitionDiff
2727import UnisonShare.Notification as Notification exposing (NotificationStatus )
2828import UnisonShare.OrgMember as OrgMember exposing (OrgMember )
2929import UnisonShare.OrgRole as OrgRole
30- import UnisonShare.Paginated as Paginated exposing (PageCursorParam (..) )
30+ import UnisonShare.Paginated as Paginated exposing (PageCursorParam )
3131import UnisonShare.Project as Project exposing (ProjectVisibility )
3232import UnisonShare.Project.ProjectRef as ProjectRef exposing (ProjectRef )
3333import UnisonShare.ProjectCollaborator exposing (ProjectCollaborator )
@@ -77,7 +77,7 @@ type alias UserBranchesParams =
7777 { searchQuery : Maybe String
7878 , projectRef : Maybe ProjectRef
7979 , limit : Int
80- , cursor : Maybe String
80+ , cursor : PageCursorParam
8181 }
8282
8383
@@ -86,10 +86,7 @@ userBranches handle params =
8686 let
8787 queryParams =
8888 int " limit" params. limit
89- :: ( params. cursor
90- |> Maybe . map ( string " cursor" )
91- |> MaybeE . toList
92- )
89+ :: Paginated . toQueryParams params. cursor
9390 ++ ( params. searchQuery
9491 |> Maybe . map ( string " name-prefix" )
9592 |> MaybeE . toList
@@ -202,15 +199,7 @@ notifications account status paginationCursor =
202199 []
203200
204201 paginationQueryParams =
205- case paginationCursor of
206- PrevPage c ->
207- [ string " prevCursor" ( Paginated . cursorToString c) ]
208-
209- NextPage c ->
210- [ string " nextCursor" ( Paginated . cursorToString c) ]
211-
212- NoPageCursor ->
213- []
202+ Paginated . toQueryParams paginationCursor
214203 in
215204 GET
216205 { path =
@@ -363,7 +352,7 @@ type alias ProjectBranchesParams =
363352 { kind : ProjectBranchesKindFilter
364353 , searchQuery : Maybe String
365354 , limit : Int
366- , cursor : Maybe String
355+ , cursor : PageCursorParam
367356 }
368357
369358
@@ -389,10 +378,7 @@ projectBranches projectRef params =
389378
390379 queryParams =
391380 [ kind, int " limit" params. limit ]
392- ++ ( params. cursor
393- |> Maybe . map ( string " cursor" )
394- |> MaybeE . toList
395- )
381+ ++ Paginated . toQueryParams params. cursor
396382 ++ ( params. searchQuery
397383 |> Maybe . map ( string " name-prefix" )
398384 |> MaybeE . toList
0 commit comments