File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,21 @@ export const sendEmailCampaign = async ({
1111 campaignRequest,
1212} : DataProtectorConsumer &
1313 SendEmailCampaignParams ) : Promise < SendEmailCampaignResponse > => {
14+ const vWorkerpoolAddressOrEns = addressOrEnsSchema ( )
15+ . required ( )
16+ . label ( 'workerpoolAddressOrEns' )
17+ . validateSync ( workerpoolAddressOrEns ) ;
18+ if (
19+ campaignRequest ?. workerpool !== NULL_ADDRESS &&
20+ vWorkerpoolAddressOrEns . toLowerCase ( ) !==
21+ campaignRequest . workerpool . toLowerCase ( )
22+ ) {
23+ throw new ValidationError (
24+ "workerpoolAddressOrEns doesn't match campaignRequest workerpool"
25+ ) ;
26+ }
27+
1428 try {
15- const vWorkerpoolAddressOrEns = addressOrEnsSchema ( )
16- . required ( )
17- . label ( 'WorkerpoolAddressOrEns' )
18- . validateSync ( workerpoolAddressOrEns ) ;
1929 // Process the prepared bulk request
2030 const processBulkRequestResponse : SendEmailCampaignResponse =
2131 await dataProtector . processBulkRequest ( {
You can’t perform that action at this time.
0 commit comments