feature/app wipe my cal (#2496)

pull/2496/merge
alannnc 2022-04-15 04:09:40 -06:00 committed by GitHub
parent 080f2bb845
commit c06d8164bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 12 deletions

View File

@ -50,7 +50,6 @@ export default class AttendeeRequestRescheduledEmail extends OrganizerScheduledE
// @OVERRIDE
protected getiCalEventAsString(): string | undefined {
console.log("overriding");
const icsEvent = createEvent({
start: dayjs(this.calEvent.startTime)
.utc()

View File

@ -56,7 +56,6 @@ export default class OrganizerRequestRescheduledEmail extends OrganizerScheduled
// @OVERRIDE
protected getiCalEventAsString(): string | undefined {
console.log("overriding");
const icsEvent = createEvent({
start: dayjs(this.calEvent.startTime)
.utc()

View File

@ -23,7 +23,6 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
let result = false;
try {
console.log("try");
const { initialDate, endDate } = req.body;
const todayBookings = await prisma.booking.findMany({
@ -37,6 +36,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
status: {
in: [BookingStatus.ACCEPTED, BookingStatus.PENDING],
},
userId: req.session.user.id,
},
select: {
id: true,
@ -44,25 +44,23 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
status: true,
},
});
// const [booking] = todayBookings;
const q = queue({ results: [] });
if (todayBookings.length > 0) {
todayBookings.forEach((booking) =>
q.push(() => {
return Reschedule(booking.uid, "Can't do it");
return Reschedule(booking.uid, "");
})
);
}
const result = await q.start();
console.log({ result });
// result = !!(await Reschedule(booking.uid, "Can't do it"));
await q.start();
} catch (error: unknown) {
if (error instanceof Error) {
return res.status(500).json({ message: error.message });
}
return res.status(500);
}
return res.status(200).json({ success: result });
return res.status(200).json({ success: true });
};
function validate(

View File

@ -51,7 +51,7 @@ export const ConfirmDialog = (props: IConfirmDialogWipe) => {
const initialDate = today.startOf("day");
const endDate = today.endOf("day");
const dateFormat = "ddd, MMM D, YYYY h:mm A";
console.log({ props });
const utils = trpc.useContext();
const rescheduleApi = useMutation(

View File

@ -49,7 +49,6 @@ export default class AttendeeRequestRescheduledEmail extends BaseTemplate {
// @OVERRIDE
protected getiCalEventAsString(): string | undefined {
console.log("overriding");
const icsEvent = createEvent({
start: dayjs(this.calEvent.startTime)
.utc()

View File

@ -56,7 +56,6 @@ export default class OrganizerRequestRescheduledEmail extends BaseTemplate {
// @OVERRIDE
protected getiCalEventAsString(): string | undefined {
console.log("overriding");
const icsEvent = createEvent({
start: dayjs(this.calEvent.startTime)
.utc()