You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/04/28 08:32:01 UTC

[GitHub] [dolphinscheduler] devosend commented on a diff in pull request #9828: [Fix] json object serialization error

devosend commented on code in PR #9828:
URL: https://github.com/apache/dolphinscheduler/pull/9828#discussion_r860625079


##########
dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts:
##########
@@ -50,7 +50,7 @@ export function useDetail(getFieldsValue: Function) {
     const dataSourceRes = await queryDataSource(id)
     status.loading = false
     PREV_NAME = dataSourceRes.name
-    return dataSourceRes
+    return dataSourceRes as IDataSource

Review Comment:
   Why did you modify it?



##########
dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts:
##########
@@ -138,9 +139,15 @@ export function useForm(id?: number) {
   const resetFieldsValue = () => {
     state.detailForm = { ...initialValues }
   }
-  const setFieldsValue = (values: object) => {
-    state.detailForm = { ...state.detailForm, ...values }
+
+  const setFieldsValue = (values: IDataSource) => {
+    state.detailForm = {
+      ...state.detailForm,
+      ...values,
+      other: JSON.stringify(values.other)

Review Comment:
   `values.other` may be null.  You should judge it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org