Make linter happy

This commit is contained in:
Neeraj Gupta
2025-01-03 12:38:08 +05:30
parent afe7705355
commit 4d5b44a4c1
4 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -1,2 +1,2 @@
ALTER TABLE public_collection_tokens
DROP COLUMN IF EXISTS enable_join;
DROP COLUMN IF EXISTS enable_join;

View File

@@ -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, "")
}

View File

@@ -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)
}