File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import * as path from "path";
66export const sendEmail = functions . onCall ( {
77 handler : async ( data ) => {
88 const content = data . data ;
9- console . log ( content ) ;
109
1110 const transporter = nodemailer . createTransport ( {
1211 host : process . env . SMTP_HOST ,
Original file line number Diff line number Diff line change @@ -307,19 +307,19 @@ const submit = async () => {
307307 const coops = cooperatorsEdit .value .map ((coop ) => new Cooperators ({... coop, userDocId: coop .userDocId || coop .id }))
308308 test .value .cooperators = [... coops]
309309
310- try {
311- await store .dispatch (' updateStudy' , test .value );
312- await store .dispatch (' getStudy' , { id: test .value .id });
313- } catch (error) {
314- console .error (' Error updating study:' , error);
315- }
316-
317310 const newCooperators = cooperatorsEdit .value .filter (
318311 (guest ) => ! cooperatorsUpdate .value .some ((c ) => c .email === guest .email )
319312 );
320313
321- for (const guest of newCooperators) {
322- await sendMenssages (guest);
314+ try {
315+ await store .dispatch (' updateStudy' , test .value );
316+
317+ await Promise .all ([
318+ store .dispatch (' getStudy' , { id: test .value .id }),
319+ ... newCooperators .map (guest => sendMenssages (guest))
320+ ]);
321+ } catch (error) {
322+ console .error (' Error updating study:' , error);
323323 }
324324};
325325
You can’t perform that action at this time.
0 commit comments