mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-07-14 10:39:43 -04:00
only show approved services in attribute view
This commit is contained in:
parent
5319b602c0
commit
394b310c8c
1 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"kycnot.me/internal/database"
|
||||
"kycnot.me/internal/ent"
|
||||
"kycnot.me/internal/ent/attribute"
|
||||
"kycnot.me/internal/ent/service"
|
||||
)
|
||||
|
||||
func Attribute(c iris.Context) {
|
||||
|
@ -25,7 +26,9 @@ func Attribute(c iris.Context) {
|
|||
aa, err := database.Client().Attribute.Query().
|
||||
Where(attribute.SlugEQ(slug)).
|
||||
Order(ent.Asc(attribute.FieldRating)).
|
||||
WithServices().
|
||||
WithServices(func(sq *ent.ServiceQuery) {
|
||||
sq.Where(service.PendingEQ(false))
|
||||
}).
|
||||
First(context.Background())
|
||||
if err != nil {
|
||||
// Handle the error (e.g., service not found)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue