mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-02-12 16:12:44 +00:00
added hide test campaigns from campaigns page
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -278,6 +278,9 @@ func (c *Campaign) GetAll(g *gin.Context) {
|
||||
}
|
||||
// parse request
|
||||
companyID := companyIDFromRequestQuery(g)
|
||||
// default to including test campaigns for backward compatibility
|
||||
// only exclude when explicitly set to "false"
|
||||
includeTestCampaigns := g.Query("includeTest") != "false"
|
||||
queryArgs, ok := c.handleQueryArgs(g)
|
||||
if !ok {
|
||||
return
|
||||
@@ -292,6 +295,7 @@ func (c *Campaign) GetAll(g *gin.Context) {
|
||||
&repository.CampaignOption{
|
||||
QueryArgs: queryArgs,
|
||||
WithCampaignTemplate: true,
|
||||
IncludeTestCampaigns: includeTestCampaigns,
|
||||
},
|
||||
)
|
||||
// handle responses
|
||||
|
||||
@@ -844,6 +844,9 @@ func (r *Campaign) GetAll(
|
||||
if err != nil {
|
||||
return result, errs.Wrap(err)
|
||||
}
|
||||
// apply test campaign filter based on options
|
||||
db = r.applyTestCampaignFilter(db, options)
|
||||
|
||||
var dbCampaigns []database.Campaign
|
||||
res := db.Find(&dbCampaigns)
|
||||
if res.Error != nil {
|
||||
|
||||
Reference in New Issue
Block a user