Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

No need to use destructor and wrap for converting to the API model

Tianzhou Chen9ea9a3a94c24
diff --git a/frontend/src/store/modules/dataSource.ts b/frontend/src/store/modules/dataSource.ts
index 0db54c2eb0..1c37d80abe 100644
--- a/frontend/src/store/modules/dataSource.ts
+++ b/frontend/src/store/modules/dataSource.ts
@@ -91,9 +91,7 @@ const actions = {
await axios.post(`/api/instance/${instanceId}/datasource`, {
data: {
type: "dataSource",
- attributes: {
- ...newDataSource,
- },
+ attributes: newDataSource,
},
})
).data.data
@@ -125,9 +123,7 @@ const actions = {
{
data: {
type: "dataSource",
- attributes: {
- ...attrs,
- },
+ attributes: attrs,
},
}
)
diff --git a/frontend/src/store/modules/environment.ts b/frontend/src/store/modules/environment.ts
index e8281af95c..ce8fa84c1a 100644
--- a/frontend/src/store/modules/environment.ts
+++ b/frontend/src/store/modules/environment.ts
@@ -54,9 +54,7 @@ const actions = {
await axios.post(`/api/environment`, {
data: {
type: "environment",
- attributes: {
- ...newEnvironment,
- },
+ attributes: newEnvironment,
},
})
).data.data
@@ -98,9 +96,7 @@ const actions = {
await axios.patch(`/api/environment/${environment.id}`, {
data: {
type: "environment",
- attributes: {
- ...attrs,
- },
+ attributes: attrs,
},
})
).data.data
diff --git a/frontend/src/store/modules/instance.ts b/frontend/src/store/modules/instance.ts
index befb344369..4233443df1 100644
--- a/frontend/src/store/modules/instance.ts
+++ b/frontend/src/store/modules/instance.ts
@@ -59,9 +59,7 @@ const actions = {
await axios.post(`/api/instance`, {
data: {
type: "instance",
- attributes: {
- ...newInstance,
- },
+ attributes: newInstance,
},
})
).data.data
@@ -79,9 +77,7 @@ const actions = {
await axios.patch(`/api/instance/${instance.id}`, {
data: {
type: "instance",
- attributes: {
- ...attrs,
- },
+ attributes: attrs,
},
})
).data.data
diff --git a/frontend/src/store/modules/task.ts b/frontend/src/store/modules/task.ts
index f05e8ff46c..637760be07 100644
--- a/frontend/src/store/modules/task.ts
+++ b/frontend/src/store/modules/task.ts
@@ -57,9 +57,7 @@ const actions = {
await axios.post(`/api/task`, {
data: {
type: "task",
- attributes: {
- ...newTask,
- },
+ attributes: newTask,
},
})
).data.data