mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-24 06:28:34 +01:00
@@ -8,5 +8,10 @@ type PaginationResult[T any] struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func calculateOffset(page, pageSize int) int {
|
func calculateOffset(page, pageSize int) int {
|
||||||
return (page - 1) * pageSize
|
offset := (page - 1) * pageSize
|
||||||
|
if offset < 0 {
|
||||||
|
return 0
|
||||||
|
} else {
|
||||||
|
return offset
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user