Add share download endpoint

This commit is contained in:
Deluan
2023-03-10 20:46:13 -05:00
committed by Deluan Quintão
parent 50d9838652
commit a22eef39f7
7 changed files with 64 additions and 27 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ func (s *shareService) Load(ctx context.Context, id string) (*model.Share, error
return nil, err
}
if !share.ExpiresAt.IsZero() && share.ExpiresAt.Before(time.Now()) {
return nil, model.ErrNotAvailable
return nil, model.ErrExpired
}
share.LastVisitedAt = time.Now()
share.VisitCount++