feat: order get requests

This commit is contained in:
2025-11-11 23:58:03 -07:00
parent 5ddedadd24
commit b6a08573f3
9 changed files with 382 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ import (
"net/http"
"ordr-api/dto"
"ordr-api/queries"
"ordr-api/utils"
"strconv"
"github.com/gin-gonic/gin"
@@ -118,7 +119,7 @@ func GetUserTable(pool *pgxpool.Pool) gin.HandlerFunc {
ctx.String(http.StatusBadRequest, "GetUserTable(): Not an integer")
return
}
rows, query_err := conn.Query(context.Background(), queries.USER_GET_TABLE_DATA, page_int*10, 10)
rows, query_err := conn.Query(context.Background(), queries.USER_GET_TABLE_DATA, page_int*utils.PAGE_SIZE, utils.PAGE_SIZE)
if query_err != nil {
ctx.String(http.StatusInternalServerError, "GetUserTable(): Failed to query database...")
log.Printf("GetUserTable(): ERROR... %s", query_err.Error())