Skip to content

Commit

Permalink
Merge pull request #4195 from systeminit/set-default-branch-based-on-…
Browse files Browse the repository at this point in the history
…request

fix(auth-api): The Auth API now accepts if a workspace is the default or not
  • Loading branch information
stack72 authored Jul 23, 2024
2 parents 93d4e24 + c432df8 commit a9f4e31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/auth-api/src/routes/workspace.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ router.post("/workspaces/new", async (ctx) => {
const reqBody = validate(ctx.request.body, z.object({
instanceUrl: z.string().url(),
displayName: z.string(),
isDefault: z.boolean(),
}));

// isDefaultWorkspace: z.boolean(),
let workspaceEnvType;
if (reqBody.instanceUrl === "https://app.systeminit.com") {
workspaceEnvType = InstanceEnvType.SI;
Expand All @@ -98,7 +98,7 @@ router.post("/workspaces/new", async (ctx) => {
workspaceEnvType,
reqBody.instanceUrl,
reqBody.displayName,
false,
reqBody.isDefault,
);

ctx.body = {
Expand Down
2 changes: 2 additions & 0 deletions bin/auth-api/src/services/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export async function createOrUpdateUserFromAuth0Details(

// create a default saas workspace
// await createWorkspace(user, InstanceEnvType.SI, "https://app.systeminit.com", `${user.nickname}'s Production Workspace`);
// we want to check if this is the first production workspace that a user has and if so, we are going to set it as the default
// when we launch this feature!
await createWorkspace(
user,
InstanceEnvType.LOCAL,
Expand Down

0 comments on commit a9f4e31

Please sign in to comment.