Allow filter post via tags

This commit is contained in:
2024-12-01 22:51:56 +08:00
parent 9dd03e0734
commit 2c138d06ee
2 changed files with 8 additions and 0 deletions

View File

@ -47,6 +47,10 @@ func universalPostFilter(c *fiber.Ctx, tx *gorm.DB) (*gorm.DB, error) {
tx = services.FilterPostWithTag(tx, c.Query("tag"))
}
if len(c.Query("type")) > 0 {
tx = services.FilterPostWithType(tx, c.Query("type"))
}
return tx, nil
}