Skip to content

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

Add the creator as the project owner upon creating the project.

天舟def5c4b7cbd4
diff --git a/frontend/src/miragejs/routes/project.js b/frontend/src/miragejs/routes/project.js
index 7ca0d7070a..a3ee95224c 100644
--- a/frontend/src/miragejs/routes/project.js
+++ b/frontend/src/miragejs/routes/project.js
@@ -59,16 +59,29 @@ export default function configureProject(route) {
});
route.post("/project", function (schema, request) {
+ const ts = Date.now();
const attrs = this.normalizedRequestAttrs("project-new");
const newProject = {
...attrs,
creatorId: attrs.creatorId,
- createdTs: Date.now(),
+ createdTs: ts,
updaterId: attrs.creatorId,
- lastUpdatedTs: Date.now(),
+ lastUpdatedTs: ts,
workspaceId: WORKSPACE_ID,
};
- return schema.projects.create(newProject);
+ const project = schema.projects.create(newProject);
+
+ schema.projectMembers.create({
+ creatorId: attrs.creatorId,
+ updaterId: attrs.creatorId,
+ createdTs: ts,
+ lastUpdatedTs: ts,
+ projectId: project.id,
+ role: "OWNER",
+ principalId: attrs.creatorId,
+ });
+
+ return project;
});
route.patch("/project/:projectId", function (schema, request) {