File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import type {
1313 UpdateRequest ,
1414 ListResponse ,
1515 SearchOptions ,
16+ DuplicateOptions ,
1617} from './types' ;
1718
1819export type Client = ReturnType < typeof createClient > ;
@@ -48,8 +49,13 @@ export function createClient(api: DeferredJobsApiClient) {
4849 return api . get < CampaignResponse > ( `${ routing . campaignsUrl } /${ id } ` ) ;
4950 }
5051
51- async function duplicate ( id : Campaign [ 'id' ] ) : Promise < CampaignResponse > {
52- return api . post < CampaignResponse > ( `${ routing . campaignsUrl } /${ id } /duplicate` ) ;
52+ async function duplicate (
53+ id : Campaign [ 'id' ] ,
54+ options ?: DuplicateOptions ,
55+ ) : Promise < CampaignResponse > {
56+ return api . post < CampaignResponse > ( `${ routing . campaignsUrl } /${ id } /duplicate` , {
57+ payload : options ,
58+ } ) ;
5359 }
5460
5561 async function doDelete ( id : Campaign [ 'id' ] ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ export interface UpdateRequest {
3535 is_click_tracking_enabled ?: boolean ;
3636}
3737
38+ export interface DuplicateOptions {
39+ with_recipients ?: boolean ;
40+ }
41+
3842export interface RecipientsOperationResponse {
3943 campaign : Campaign ;
4044 warnings : Warning [ ] ;
You can’t perform that action at this time.
0 commit comments