Skip to content

Commit 516aab7

Browse files
committed
Merge branch 'main' of github.com:ut-code/CourseMate into make-it-ssg
2 parents 9e393ac + dd4c9e1 commit 516aab7

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"**/Cargo.*",
5555
"scraper/target",
5656
"**/rust-toolchain.toml",
57-
"web/out"
57+
"web/out",
58+
"**/tsconfig.tsbuildinfo"
5859
]
5960
}

server/src/database/chat.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export async function deleteMessage(
312312
export async function getLastMessage(
313313
userId: UserID,
314314
friendId: UserID,
315-
): Promise<Message> {
315+
): Promise<Message | undefined> {
316316
const rel = await getRelation(userId, friendId);
317317
if (!rel) throw new Error("relation not found"); // relation not found
318318
const lastMessage = await prisma.message.findFirst({
@@ -324,8 +324,7 @@ export async function getLastMessage(
324324
},
325325
take: 1,
326326
});
327-
if (!lastMessage) throw new Error("last message not found");
328-
return lastMessage;
327+
return lastMessage ?? undefined;
329328
}
330329

331330
// only works on Relationship (= DM) for now.

web/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ next-env.d.ts
2828
out
2929

3030
/common
31+
32+
tsconfig.tsbuildinfo

0 commit comments

Comments
 (0)