2022-07-20 03:36:00 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import sendExportedPresentationChatMsg from '/imports/api/presentations/server/handlers/sendExportedPresentationChatMsg';
|
|
|
|
import setPresentationExporting from '/imports/api/presentations/server/modifiers/setPresentationExporting';
|
2023-04-20 19:48:43 +08:00
|
|
|
import setOriginalUriDownload from '/imports/api/presentations/server/modifiers/setOriginalUriDownload';
|
2022-07-20 03:36:00 +08:00
|
|
|
|
2023-03-15 01:27:52 +08:00
|
|
|
export default async function handlePresentationExport({ body }, meetingId) {
|
2022-07-20 03:36:00 +08:00
|
|
|
check(body, Object);
|
|
|
|
check(meetingId, String);
|
|
|
|
|
2023-04-17 20:04:58 +08:00
|
|
|
const { fileURI, presId, typeOfExport } = body;
|
2022-07-20 03:36:00 +08:00
|
|
|
|
|
|
|
check(fileURI, String);
|
2022-07-26 21:19:23 +08:00
|
|
|
check(presId, String);
|
2023-04-17 20:04:58 +08:00
|
|
|
check(typeOfExport, Match.Maybe(String));
|
2022-07-20 03:36:00 +08:00
|
|
|
|
2023-04-20 19:48:43 +08:00
|
|
|
if (typeOfExport === "Original") {
|
|
|
|
setOriginalUriDownload(meetingId, presId, fileURI)
|
|
|
|
} else {
|
|
|
|
await sendExportedPresentationChatMsg(meetingId, presId, fileURI, typeOfExport);
|
|
|
|
}
|
2023-03-15 01:27:52 +08:00
|
|
|
await setPresentationExporting(meetingId, presId, { status: 'EXPORTED' });
|
2022-07-20 03:36:00 +08:00
|
|
|
}
|