2021-08-12 04:54:20 +02:00
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/photoprism/photoprism/internal/entity"
|
|
|
|
)
|
|
|
|
|
2021-08-16 00:29:36 +02:00
|
|
|
// Subjects returns subjects from the index.
|
|
|
|
func Subjects(limit, offset int) (result entity.Subjects, err error) {
|
2021-08-12 04:54:20 +02:00
|
|
|
stmt := Db()
|
|
|
|
|
|
|
|
stmt = stmt.Order("id").Limit(limit).Offset(offset)
|
|
|
|
err = stmt.Find(&result).Error
|
|
|
|
|
|
|
|
return result, err
|
|
|
|
}
|