call model with limits in post (#65)

This commit is contained in:
Asim Aslam
2021-02-05 11:52:57 +00:00
committed by GitHub
parent 2c53892bc6
commit 470036abef
5 changed files with 19 additions and 1 deletions

View File

@@ -187,6 +187,8 @@ func (p *Posts) Index(ctx context.Context, req *proto.IndexRequest, rsp *proto.I
// create a simple descending order query
q := model.QueryEquals("created", nil)
q.Order.Type = model.OrderTypeDesc
q.Offset = req.Offset
q.Limit = req.Limit
var posts []*proto.Post