This commit is contained in:
Stash Dev
2019-02-14 15:42:52 -08:00
parent 1d00b2b36f
commit b488c1ed7d
111 changed files with 141 additions and 141 deletions

View File

@@ -0,0 +1,22 @@
package api
import (
"context"
"github.com/stashapp/stash/pkg/models"
"strconv"
)
func (r *queryResolver) FindGallery(ctx context.Context, id string) (*models.Gallery, error) {
qb := models.NewGalleryQueryBuilder()
idInt, _ := strconv.Atoi(id)
return qb.Find(idInt)
}
func (r *queryResolver) FindGalleries(ctx context.Context, filter *models.FindFilterType) (models.FindGalleriesResultType, error) {
qb := models.NewGalleryQueryBuilder()
galleries, total := qb.Query(filter)
return models.FindGalleriesResultType{
Count: total,
Galleries: galleries,
}, nil
}