Improve file tile

This commit is contained in:
2025-10-04 18:42:45 +08:00
parent 02a33e00b3
commit ff30125518
5 changed files with 49 additions and 9 deletions

View File

@@ -41,6 +41,7 @@ func GetResourceByID(id uint) (model.Resource, error) {
}).
Preload("Files").
Preload("Files.User").
Preload("Files.Storage").
First(&r, id).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return model.Resource{}, model.NewNotFoundError("Resource not found")