mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2026-02-04 02:56:30 -06:00
parent
1d3d7b4788
commit
04df4d8a08
@ -8,5 +8,10 @@ type PaginationResult[T any] struct {
|
||||
}
|
||||
|
||||
func calculateOffset(page, pageSize int) int {
|
||||
return (page - 1) * pageSize
|
||||
offset := (page - 1) * pageSize
|
||||
if offset < 0 {
|
||||
return 0
|
||||
} else {
|
||||
return offset
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user