Skip to content

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

Swap the environment and db name order in create datasource template

Tianzhou Chen0d3c85e7e16e
diff --git a/frontend/src/miragejs/seeds/index.js b/frontend/src/miragejs/seeds/index.js
index 8229393952..4bfd00b8e3 100644
--- a/frontend/src/miragejs/seeds/index.js
+++ b/frontend/src/miragejs/seeds/index.js
@@ -127,8 +127,8 @@ const workspacesSeeder = (server) => {
},
],
payload: {
- 1: "db1",
- 2: environmentList1[1].id,
+ 1: environmentList1[1].id,
+ 2: "db1",
},
workspace: workspace1,
});
diff --git a/frontend/src/plugins/task/template.ts b/frontend/src/plugins/task/template.ts
index 51972efd00..e1a2e453b8 100644
--- a/frontend/src/plugins/task/template.ts
+++ b/frontend/src/plugins/task/template.ts
@@ -62,29 +62,29 @@ const allTaskTemplateList: TaskTemplate[] = [
{
category: "INPUT",
id: 1,
- slug: "db",
- name: "Database Name",
- type: "String",
+ slug: "env",
+ name: "Environment",
+ type: "Environment",
required: true,
- preprocessor: (name: string): string => {
+ preprocessor: (environmentId: EnvironmentId): string => {
// In case caller passes corrupted data.
// Handled here instead of the caller, because it's
// preprocessor specific behavior to handle fallback.
- return name?.toLowerCase();
+ return environmentId;
},
},
{
category: "INPUT",
id: 2,
- slug: "env",
- name: "Environment",
- type: "Environment",
+ slug: "db",
+ name: "Database Name",
+ type: "String",
required: true,
- preprocessor: (environmentId: EnvironmentId): string => {
+ preprocessor: (name: string): string => {
// In case caller passes corrupted data.
// Handled here instead of the caller, because it's
// preprocessor specific behavior to handle fallback.
- return environmentId;
+ return name?.toLowerCase();
},
},
{