Skip to content

Commit

Permalink
Fix onboarding status refacto (#6533)
Browse files Browse the repository at this point in the history
see comments in
#6531 (review)
- rename method
- add check before setting create profile pending user var
  • Loading branch information
martmull authored Aug 7, 2024
1 parent 8408cf6 commit 10817c5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class BackfillNewOnboardingUserVarsCommand extends CommandRunner {
});

for (const user of workspace.users) {
await this.onboardingService.setOnboardingCreateProfileCompletion({
await this.onboardingService.setOnboardingCreateProfilePending({
userId: user.id,
workspaceId: workspace.id,
value: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,13 @@ export class SignInUpService {
value: true,
});

await this.onboardingService.setOnboardingCreateProfileCompletion({
userId: user.id,
workspaceId: workspace.id,
value: true,
});
if (firstName === '' && lastName === '') {
await this.onboardingService.setOnboardingCreateProfilePending({
userId: user.id,
workspaceId: workspace.id,
value: true,
});
}

return user;
}
Expand Down Expand Up @@ -257,11 +259,13 @@ export class SignInUpService {
value: true,
});

await this.onboardingService.setOnboardingCreateProfileCompletion({
userId: user.id,
workspaceId: workspace.id,
value: true,
});
if (firstName === '' && lastName === '') {
await this.onboardingService.setOnboardingCreateProfilePending({
userId: user.id,
workspaceId: workspace.id,
value: true,
});
}

await this.onboardingService.setOnboardingInviteTeamPending({
workspaceId: workspace.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class OnboardingService {
});
}

async setOnboardingCreateProfileCompletion({
async setOnboardingCreateProfilePending({
userId,
workspaceId,
value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class WorkspaceWorkspaceMemberListener {
return;
}

await this.onboardingService.setOnboardingCreateProfileCompletion({
await this.onboardingService.setOnboardingCreateProfilePending({
userId: payload.userId,
workspaceId: payload.workspaceId,
value: false,
Expand Down

0 comments on commit 10817c5

Please sign in to comment.