mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
Improve file tile
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user