Skip to content

Commit 70e473a

Browse files
committed
#4039 check title whitespace backend
1 parent 3d39e77 commit 70e473a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/backend/src/services/calendar.services.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ export default class CalendarService {
271271
zoomLink?: string,
272272
description?: string
273273
): Promise<Event> {
274+
if (!title.trim()) throw new HttpException(400, 'Title cannot be only whitespace');
275+
274276
// Validate eventTypeId
275277
const foundEventType = await prisma.event_Type.findUnique({
276278
where: { eventTypeId }
@@ -592,6 +594,8 @@ export default class CalendarService {
592594
zoomLink?: string,
593595
description?: string
594596
): Promise<Event> {
597+
if (!title.trim()) throw new HttpException(400, 'Title cannot be only whitespace');
598+
595599
// validate eventId
596600
const foundEvent = await prisma.event.findUnique({
597601
where: { eventId },

0 commit comments

Comments
 (0)