Make linter happy
This commit is contained in:
@@ -63,10 +63,10 @@ func (p PublicCollectionToken) CanJoin() error {
|
||||
if p.ValidTill > 0 && p.ValidTill < time.Microseconds() {
|
||||
return NewBadRequestWithMessage("token expired")
|
||||
}
|
||||
if p.EnableDownload == false {
|
||||
if !p.EnableDownload {
|
||||
return NewBadRequestWithMessage("can not join as download is disabled")
|
||||
}
|
||||
if p.EnableJoin == false {
|
||||
if !p.EnableJoin {
|
||||
return NewBadRequestWithMessage("can not join as join is disabled")
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
ALTER TABLE public_collection_tokens
|
||||
DROP COLUMN IF EXISTS enable_join;
|
||||
DROP COLUMN IF EXISTS enable_join;
|
||||
|
||||
@@ -193,7 +193,7 @@ func (c *CollectionController) JoinViaLink(ctx *gin.Context, req ente.JoinCollec
|
||||
if !collection.AllowSharing() {
|
||||
return stacktrace.Propagate(ente.ErrBadRequest, fmt.Sprintf("joining %s is not allowed", collection.Type))
|
||||
}
|
||||
publicCollectionToken, err := c.PublicCollectionCtrl.GetCollectionSummaryByToken(ctx, req.CollectionID)
|
||||
publicCollectionToken, err := c.PublicCollectionCtrl.GetActivePublicCollectionToken(ctx, req.CollectionID)
|
||||
if err != nil {
|
||||
return stacktrace.Propagate(err, "")
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ func (c *PublicCollectionController) CreateAccessToken(ctx context.Context, req
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (c *PublicCollectionController) GetCollectionSummaryByToken(ctx context.Context, collectionID int64) (ente.PublicCollectionToken, error) {
|
||||
func (c *PublicCollectionController) GetActivePublicCollectionToken(ctx context.Context, collectionID int64) (ente.PublicCollectionToken, error) {
|
||||
return c.PublicCollectionRepo.GetActivePublicCollectionToken(ctx, collectionID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user