File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 5454 " **/Cargo.*" ,
5555 " scraper/target" ,
5656 " **/rust-toolchain.toml" ,
57- " web/out"
57+ " web/out" ,
58+ " **/tsconfig.tsbuildinfo"
5859 ]
5960}
Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ export async function deleteMessage(
312312export 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.
Original file line number Diff line number Diff line change @@ -28,3 +28,5 @@ next-env.d.ts
2828out
2929
3030/common
31+
32+ tsconfig.tsbuildinfo
You can’t perform that action at this time.
0 commit comments