From a23b2cc3a3514d892d70cac860e10484b5f3132b Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 28 Nov 2023 23:08:54 +0100 Subject: [PATCH] Fixed #292 --- internal/mock_api/endpoints/users/blocks.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/mock_api/endpoints/users/blocks.go b/internal/mock_api/endpoints/users/blocks.go index a3ca8d0d..21a1c305 100644 --- a/internal/mock_api/endpoints/users/blocks.go +++ b/internal/mock_api/endpoints/users/blocks.go @@ -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)