diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d5237a7..5f2354a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,9 @@
-
+
-
-
-
+
@@ -119,7 +117,8 @@
-
+
+
true
diff --git a/pkg/internal/server/api/attachment_dir_api.go b/pkg/internal/server/api/attachment_dir_api.go
index 59ae264..b689927 100644
--- a/pkg/internal/server/api/attachment_dir_api.go
+++ b/pkg/internal/server/api/attachment_dir_api.go
@@ -62,6 +62,10 @@ func listAttachment(c *fiber.Ctx) error {
tx = tx.Where("usage IN ?", strings.Split(usage, " "))
}
+ if original := c.QueryBool("original", false); original {
+ tx = tx.Where("ref_id IS NULL")
+ }
+
var count int64
countTx := tx
if err := countTx.Model(&models.Attachment{}).Count(&count).Error; err != nil {