added AllowDenyIDs for get campaign by id endpoint

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2025-12-25 11:27:39 +01:00
parent 00d4cb13fe
commit dee61c2633

View File

@@ -1514,9 +1514,11 @@ func ToCampaign(row *database.Campaign) (*model.Campaign, error) {
} }
} }
allowDeny := []*model.AllowDeny{} allowDeny := []*model.AllowDeny{}
allowDenyIDs := []*uuid.UUID{}
if row.AllowDeny != nil { if row.AllowDeny != nil {
for _, ad := range row.AllowDeny { for _, ad := range row.AllowDeny {
allowDeny = append(allowDeny, ToAllowDeny(ad)) allowDeny = append(allowDeny, ToAllowDeny(ad))
allowDenyIDs = append(allowDenyIDs, ad.ID)
} }
} }
var denyPage *model.Page var denyPage *model.Page
@@ -1624,6 +1626,7 @@ func ToCampaign(row *database.Campaign) (*model.Campaign, error) {
RecipientGroups: recipientGroups, RecipientGroups: recipientGroups,
RecipientGroupIDs: nullable.NewNullableWithValue(recipientGroupIDs), RecipientGroupIDs: nullable.NewNullableWithValue(recipientGroupIDs),
AllowDeny: allowDeny, AllowDeny: allowDeny,
AllowDenyIDs: nullable.NewNullableWithValue(allowDenyIDs),
DenyPage: denyPage, DenyPage: denyPage,
DenyPageID: denyPageID, DenyPageID: denyPageID,
EvasionPage: evasionPage, EvasionPage: evasionPage,