Skip to content

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

Make payload field required to avoid if-else block in implemenation

Tianzhou Chen552447605915
diff --git a/frontend/src/plugins/task/template.ts b/frontend/src/plugins/task/template.ts
index 24c9df886b..f4370056e7 100644
--- a/frontend/src/plugins/task/template.ts
+++ b/frontend/src/plugins/task/template.ts
@@ -10,7 +10,7 @@ export const taskTemplateList: TaskTemplate[] = [
attributes: {
name: "New General Task",
type: "bytebase.general",
- content: "blablabla",
+ content: "",
stageProgressList: [
{
id: "1",
@@ -23,6 +23,7 @@ export const taskTemplateList: TaskTemplate[] = [
id: ctx.currentUser.id,
name: ctx.currentUser.attributes.name,
},
+ payload: {},
},
};
},
@@ -48,6 +49,7 @@ export const taskTemplateList: TaskTemplate[] = [
id: ctx.currentUser.id,
name: ctx.currentUser.attributes.name,
},
+ payload: {},
},
};
},
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index 6461f30d9f..c03fec0388 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -62,7 +62,7 @@ export type StageProgress = Stage & {
};
// Task
-type TaskTypeGeneral = "bytebase.general.create";
+type TaskTypeGeneral = "bytebase.general";
type TaskTypeDataSource = "bytebase.datasource.create";
@@ -107,7 +107,7 @@ export type TaskNew = Omit<ResourceObject, "id"> & {
id: string;
name: string;
};
- payload?: any;
+ payload: any;
};
};