add position preload

This commit is contained in:
andrusyakka
2023-07-05 18:49:33 +03:00
parent d6e21f7f38
commit 0200810eae
2 changed files with 1 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ func (h *Handler) GetUsers(c echo.Context) error {
utils.ApplySort(tx, sortCol, isDesc)
utils.ApplyFilters(tx, filterCol, filterVal)
tx = tx.Find(&users)
tx = tx.Preload("Position").Find(&users)
if tx.RowsAffected == 1 {
return c.JSON(http.StatusOK, users[0])

BIN
test.db

Binary file not shown.