refac: repository updates, image attachment and deletes report the domain not-found error for an unknown id, the same for articles, users and images, and the test fakes stop returning GORM errors

This commit is contained in:
fsylvain committed 2026-09-23 22:09:06 +02:00
1 parent 4278d96882
commit 6a2ca07b66
14 files changed
+553 -66

No files matched your search

+1 -3
View File
@@ -7,8 +7,6 @@ import (
"io"
"strings"
"testing"
"gorm.io/gorm"
)
var errUnsupportedImageContentType = errors.New("the file must be a PNG, JPEG, WEBP, or SVG image")
@@ -51,7 +49,7 @@ func (m *mockImageRepo) Delete(id uint32) error {
return err
}
if _, ok := m.images[id]; !ok {
return gorm.ErrRecordNotFound
return imageDomain.ErrImageNotFound
}
delete(m.images, id)
return nil