Skip to content

Commit

Permalink
✨ Batch list attachment meta
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleSheep2Code committed Aug 2, 2024
1 parent a696b13 commit b093e28
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/internal/server/api/attachment_dir_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func listAttachment(c *fiber.Ctx) error {

tx := database.C.Order("created_at DESC")

if len(c.Query("id")) > 0 {
tx = tx.Where("id IN ?", strings.Split(c.Query("id"), ","))
}

if len(c.Query("author")) > 0 {
var author models.Account
if err := database.C.Where("name = ?", c.Query("author")).First(&author).Error; err != nil {
Expand Down

0 comments on commit b093e28

Please sign in to comment.