File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,15 @@ export const fetchPostById = async (
31
31
),
32
32
images (*),
33
33
replies (
34
- id
34
+ id,
35
+ deleted_at
35
36
),
36
37
likes (*)
37
38
` ,
38
39
)
39
40
. eq ( 'id' , id )
41
+ . filter ( 'replies.deleted_at' , 'is' , null )
40
42
. single ( ) ;
41
-
42
43
if ( error ) {
43
44
if ( __DEV__ ) console . error ( 'Error fetching post by ID:' , error ) ;
44
45
return null ;
@@ -64,12 +65,14 @@ export const fetchPostPagination = async ({
64
65
user:user_id (*),
65
66
images (*),
66
67
replies (
67
- id
68
+ id,
69
+ deleted_at
68
70
),
69
71
likes (*)
70
72
` ,
71
73
)
72
74
. is ( 'deleted_at' , null )
75
+ . filter ( 'replies.deleted_at' , 'is' , null )
73
76
. order ( 'created_at' , { ascending : false } )
74
77
. limit ( limit )
75
78
. lt ( 'created_at' , cursor ) ;
@@ -118,7 +121,8 @@ export const fetchUpdatePost = async ({
118
121
),
119
122
images (*),
120
123
replies (
121
- id
124
+ id,
125
+ deleted_at
122
126
),
123
127
likes (*)
124
128
` ,
@@ -210,7 +214,8 @@ export const fetchCreatePost = async (
210
214
),
211
215
images (*),
212
216
replies (
213
- id
217
+ id,
218
+ deleted_at
214
219
),
215
220
likes (*)
216
221
` ,
You can’t perform that action at this time.
0 commit comments