feat(campaigns): start_date for threat-actor-generated campaigns
Backend: - campaign_service.generate_campaign_from_threat_actor: accept optional start_date kwarg and set it on the Campaign model - campaigns router: new GenerateFromActorPayload schema, /from-threat-actor endpoint now accepts optional body with start_date Frontend: - generateCampaignFromThreatActor API: accept optional options param - Generate Campaign modal: date picker + warning message, same UX as the manual create form
This commit is contained in:
@@ -155,8 +155,14 @@ export async function getCampaignProgress(campaignId: string): Promise<CampaignP
|
||||
}
|
||||
|
||||
/** Generate a campaign from a threat actor. */
|
||||
export async function generateCampaignFromThreatActor(actorId: string): Promise<Campaign> {
|
||||
const { data } = await client.post<Campaign>(`/campaigns/from-threat-actor/${actorId}`);
|
||||
export async function generateCampaignFromThreatActor(
|
||||
actorId: string,
|
||||
options?: { start_date?: string },
|
||||
): Promise<Campaign> {
|
||||
const { data } = await client.post<Campaign>(
|
||||
`/campaigns/from-threat-actor/${actorId}`,
|
||||
options ?? {},
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user