File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,8 @@ export const postRouter = createTRPCRouter({
32
32
const post = ctx . db . query . posts . findFirst ( {
33
33
orderBy : ( posts , { desc } ) => [ desc ( posts . createdAt ) ] ,
34
34
} ) ;
35
- if ( post === undefined ) {
36
- return null ;
37
- }
38
- return post ;
35
+
36
+ return post ?? null ;
39
37
} ) ,
40
38
41
39
getSecretMessage : protectedProcedure . query ( ( ) => {
Original file line number Diff line number Diff line change @@ -34,10 +34,8 @@ export const postRouter = createTRPCRouter({
34
34
orderBy : { createdAt : "desc" } ,
35
35
where : { createdBy : { id : ctx . session . user . id } } ,
36
36
} ) ;
37
- if ( post === undefined ) {
38
- return null ;
39
- }
40
- return post ;
37
+
38
+ return post ?? null ;
41
39
} ) ,
42
40
43
41
getSecretMessage : protectedProcedure . query ( ( ) => {
You can’t perform that action at this time.
0 commit comments