Skip to content

Commit 2f5151e

Browse files
committed
fix: buid error again
1 parent 1348954 commit 2f5151e

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/routes/inviteRoutes.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
getEventRsvpSummary,
1111
getEventGuestList,
1212
bulkCreateInvites,
13-
sendWhatsappInvite,
1413
getEventRsvps
1514
} from '../services/inviteService';
1615
import { verifyIdToken } from '../middleware/verifyIdToken';
@@ -512,36 +511,4 @@ router.get('/:eventId/:groupId/status/:phoneNo', async (_req: Request, res: Resp
512511
res.status(403).json({ message: 'RSVP status can be viewed and managed in the app. Please download the app to continue.' });
513512
});
514513

515-
router.post(
516-
'/send-invite/:eventId/:groupId',
517-
verifyIdToken,
518-
async (req: Request, res: Response) => {
519-
try {
520-
const { eventId, groupId } = req.params;
521-
const { name, phone_no } = req.body;
522-
const userId = req.userId; // This is the ID of the user sending the invite
523-
if (!userId) {
524-
res.status(401).json({ message: 'Unauthorized' });
525-
return;
526-
}
527-
528-
const isAuthorized = await isEventHostOrCoHost(userId, eventId);
529-
if (!isAuthorized) {
530-
return res.status(403).json({ message: 'Only event hosts can send invites' });
531-
}
532-
533-
// Pass the sender's userId to the service function
534-
const result = await sendWhatsappInvite(userId, eventId, groupId, name, phone_no);
535-
536-
if (!result.success) {
537-
return res.status(400).json({ message: result.error });
538-
}
539-
540-
res.status(200).json({ message: 'Invite link sent successfully' });
541-
} catch (error: any) {
542-
console.error(error);
543-
res.status(500).json({ message: error.message || 'Internal Server Error' });
544-
}
545-
}
546-
);
547514
export default router;

0 commit comments

Comments
 (0)