Properly concat results and properly handle zoom meeting uuids
This commit is contained in:
parent
3cf00043b1
commit
8e9868db30
1 changed files with 4 additions and 4 deletions
|
@ -80,7 +80,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
});
|
});
|
||||||
|
|
||||||
let results = [];
|
let results = [];
|
||||||
let referencesToCreate = undefined;
|
let referencesToCreate = [];
|
||||||
|
|
||||||
if (rescheduleUid) {
|
if (rescheduleUid) {
|
||||||
// Reschedule event
|
// Reschedule event
|
||||||
|
@ -135,7 +135,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// Schedule event
|
// Schedule event
|
||||||
results.concat(await async.mapLimit(calendarCredentials, 5, async (credential) => {
|
results = results.concat(await async.mapLimit(calendarCredentials, 5, async (credential) => {
|
||||||
const response = await createEvent(credential, appendLinksToEvents(evt));
|
const response = await createEvent(credential, appendLinksToEvents(evt));
|
||||||
return {
|
return {
|
||||||
type: credential.type,
|
type: credential.type,
|
||||||
|
@ -143,7 +143,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
results.concat(await async.mapLimit(videoCredentials, 5, async (credential) => {
|
results = results.concat(await async.mapLimit(videoCredentials, 5, async (credential) => {
|
||||||
const response = await createMeeting(credential, meeting);
|
const response = await createMeeting(credential, meeting);
|
||||||
return {
|
return {
|
||||||
type: credential.type,
|
type: credential.type,
|
||||||
|
@ -154,7 +154,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
referencesToCreate = results.map((result => {
|
referencesToCreate = results.map((result => {
|
||||||
return {
|
return {
|
||||||
type: result.type,
|
type: result.type,
|
||||||
uid: result.response.id
|
uid: result.response.uuid ?? result.response.id
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue