Skip to content

Commit

Permalink
fix: wrong columnName index
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 9, 2022
1 parent 4632565 commit 63569be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/db/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func GetStorages(pageIndex, pageSize int) ([]model.Storage, int64, error) {
return nil, 0, errors.Wrapf(err, "failed get storages count")
}
var storages []model.Storage
if err := storageDB.Order(columnName("index")).Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&storages).Error; err != nil {
if err := storageDB.Order(columnName("order")).Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&storages).Error; err != nil {
return nil, 0, errors.WithStack(err)
}
return storages, count, nil
Expand Down

0 comments on commit 63569be

Please sign in to comment.