Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Dkamps18 committed Nov 28, 2023
1 parent fe21ba4 commit a23b2cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/mock_api/endpoints/users/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ func getBlocks(w http.ResponseWriter, r *http.Request) {
}

apiResponse := models.APIResponse{
Data: dbr.Data,
Data: dbr.Data,
Pagination: &models.APIPagination{},
}

if len(dbr.Data.([]database.Block)) == 0 {
dbr.Data = make([]database.Block, 0)
apiResponse.Data = []database.Block{}
}

if len(dbr.Data.([]database.Block)) == dbr.Limit {
apiResponse.Pagination = &models.APIPagination{Cursor: dbr.Cursor}
apiResponse.Pagination.Cursor = dbr.Cursor
}

bytes, _ := json.Marshal(apiResponse)
Expand Down

0 comments on commit a23b2cc

Please sign in to comment.