Skip to content

Commit ee6c71d

Browse files
committed
fix: discussions with supabase questions
1 parent 69912aa commit ee6c71d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/routes/api.discussions.$sourceId.comments.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ export async function action({ params, request }: LoaderFunctionArgs) {
122122

123123
const newComment = {
124124
comment: data.comment,
125-
source_id_legacy:
126-
typeof params.sourceId === 'string' ? params.sourceId : null,
127-
source_id: typeof params.sourceId === 'number' ? params.sourceId : null,
125+
source_id_legacy: isNaN(+params.sourceId!) ? params.sourceId : null,
126+
source_id: isNaN(+params.sourceId!) ? null : +params.sourceId!,
128127
source_type: data.sourceType,
129128
created_by: currentUser.data.id,
130129
parent_id: data.parentId ?? null,

0 commit comments

Comments
 (0)