add position preload
This commit is contained in:
@@ -42,7 +42,7 @@ func (h *Handler) GetUsers(c echo.Context) error {
|
|||||||
utils.ApplySort(tx, sortCol, isDesc)
|
utils.ApplySort(tx, sortCol, isDesc)
|
||||||
utils.ApplyFilters(tx, filterCol, filterVal)
|
utils.ApplyFilters(tx, filterCol, filterVal)
|
||||||
|
|
||||||
tx = tx.Find(&users)
|
tx = tx.Preload("Position").Find(&users)
|
||||||
|
|
||||||
if tx.RowsAffected == 1 {
|
if tx.RowsAffected == 1 {
|
||||||
return c.JSON(http.StatusOK, users[0])
|
return c.JSON(http.StatusOK, users[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user