feat: add list of currencies

This commit is contained in:
2026-04-17 15:12:41 +02:00
parent ec44200332
commit 93a7dd1718
10 changed files with 102 additions and 35 deletions

View File

@@ -31,7 +31,11 @@ func Paginate[T any](langID uint, paging Paging, stmt *gorm.DB) (Found[T], error
var items []T
var count int64
stmt.Count(&count)
countStmt := stmt.Session(&gorm.Session{}).Select("count(*)").Offset(-1).Limit(-1)
if err := countStmt.Count(&count).Error; err != nil {
return Found[T]{}, err
}
err := stmt.
Offset(paging.Offset()).
@@ -42,15 +46,10 @@ func Paginate[T any](langID uint, paging Paging, stmt *gorm.DB) (Found[T], error
return Found[T]{}, err
}
// columnsSpec := GetColumnsSpec[T](langID)
return Found[T]{
Items: items,
Count: uint(count),
// Spec: map[string]interface{}{
// "columns": columnsSpec,
// },
}, err
}, nil
}
// GetColumnsSpec[T any] generates a column specification map for a given struct type T.