Skip to content

Commit

Permalink
Fix connector template
Browse files Browse the repository at this point in the history
  • Loading branch information
demdxx committed Sep 17, 2024
1 parent 9c80974 commit 960a36c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/graphql/connectors/connector_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ func (c *CollectionConnection[GQLM, EdgeT]) PageInfo() *gqlmodels.PageInfo {
c.pageInfo.StartCursor = gocast.Str(cur1)
c.pageInfo.EndCursor = gocast.Str(cur2)
}
if c.page != nil && c.page.Size != nil && c.page.StartPage != nil {
c.pageInfo.Page = *c.page.StartPage
c.pageInfo.Count = c.pageInfo.Count/(*c.page.Size) + gocast.Int(c.pageInfo.Count%(*c.page.Size) > 0)
c.pageInfo.HasNextPage = c.pageInfo.Count > c.pageInfo.Page
if c.page != nil && c.page.Size != nil {
c.pageInfo.Page = gocast.PtrAsValue(c.page.StartPage, 0)
c.pageInfo.Count = c.pageInfo.Total/(*c.page.Size) + gocast.Int(c.pageInfo.Total%(*c.page.Size) > 0)
c.pageInfo.HasNextPage = c.pageInfo.Total > c.pageInfo.Page
c.pageInfo.HasPreviousPage = c.pageInfo.Page > 1
}
}
Expand Down

0 comments on commit 960a36c

Please sign in to comment.