feat: reintroducing thumbnails (#3821)

* Reintroducing thumbnails

* Aligned with linting rules

* making recomended code review change
- changed method names to start with lower case as they are not used outside of their package
- made receiver types for struct funcs to be pointers to not need to create copies

Trying to cover all linting issues
- converted slog warning to use attributes when logging warnings
- seperated imports to have package files in their own section

* Update go.mod

---------

Co-authored-by: boojack <24653555+boojack@users.noreply.github.com>
This commit is contained in:
RoccoSmit
2024-08-29 23:01:57 +10:00
committed by GitHub
parent 615aa94793
commit 9b1adfbbe9
11 changed files with 336 additions and 84 deletions

View File

@@ -365,6 +365,11 @@ func (s *APIV1Service) DeleteMemo(ctx context.Context, request *v1pb.DeleteMemoR
if err := s.Store.DeleteResource(ctx, &store.DeleteResource{ID: resource.ID}); err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete resource")
}
thumb := thumbnail{resource}
if err := thumb.deleteFile(s.Profile.Data); err != nil {
slog.Warn("failed to delete resource thumbnail")
}
}
// Delete memo comments