mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-02-12 16:12:44 +00:00
fix missing allow deny list on campaign create
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -152,6 +152,7 @@ func (r *Campaign) Insert(
|
||||
if err != nil {
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
|
||||
if allowDeny, err := campaign.AllowDenyIDs.Get(); err == nil && len(allowDeny) > 0 {
|
||||
err = r.AddAllowDenyLists(ctx, &id, allowDeny)
|
||||
if err != nil {
|
||||
@@ -211,7 +212,6 @@ func (r *Campaign) AddAllowDenyLists(
|
||||
campaignID *uuid.UUID,
|
||||
allowDenyIDs []*uuid.UUID,
|
||||
) error {
|
||||
|
||||
batch := []database.CampaignAllowDeny{}
|
||||
for _, id := range allowDenyIDs {
|
||||
batch = append(batch, database.CampaignAllowDeny{
|
||||
|
||||
@@ -164,11 +164,13 @@ func (c *Campaign) Create(
|
||||
c.Logger.Errorw("failed to create campaign", "error", err)
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
|
||||
createdCampaign, err := c.CampaignRepository.GetByID(
|
||||
ctx,
|
||||
id,
|
||||
&repository.CampaignOption{
|
||||
WithRecipientGroups: true,
|
||||
WithAllowDeny: true,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user