mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-03-06 05:55:50 -05:00
only show approved services in attribute view
This commit is contained in:
parent
5319b602c0
commit
394b310c8c
@ -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…
x
Reference in New Issue
Block a user