mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 19:29:15 +00:00
* Split long functions and optimize code * Addressing comments * Remove unnecessary input param --------- Co-authored-by: Konstantin Koval
22 lines
545 B
Go
22 lines
545 B
Go
package resolvers
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/photoview/photoview/api/graphql/auth"
|
|
"github.com/photoview/photoview/api/graphql/models"
|
|
"github.com/photoview/photoview/api/graphql/models/actions"
|
|
)
|
|
|
|
func (r *queryResolver) MyTimeline(ctx context.Context, paginate *models.Pagination, onlyFavorites *bool,
|
|
fromDate *time.Time) ([]*models.Media, error) {
|
|
|
|
user := auth.UserFromContext(ctx)
|
|
if user == nil {
|
|
return nil, auth.ErrUnauthorized
|
|
}
|
|
|
|
return actions.MyTimeline(r.DB(ctx), user, paginate, onlyFavorites, fromDate)
|
|
}
|