We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69912aa commit ee6c71dCopy full SHA for ee6c71d
src/routes/api.discussions.$sourceId.comments.ts
@@ -122,9 +122,8 @@ export async function action({ params, request }: LoaderFunctionArgs) {
122
123
const newComment = {
124
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,
+ source_id_legacy: isNaN(+params.sourceId!) ? params.sourceId : null,
+ source_id: isNaN(+params.sourceId!) ? null : +params.sourceId!,
128
source_type: data.sourceType,
129
created_by: currentUser.data.id,
130
parent_id: data.parentId ?? null,
0 commit comments