hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
180 stars 105 forks source link

[FIX] C#: Unable to Create Organization During Account Setup #803

Open Promachi opened 4 weeks ago

Promachi commented 4 weeks ago

Description

As a User, I am unable to create an organisation during account setup. Even after selecting the "Create Organization" option, the organization is not created and a verification error message pops up. This issue disrupts the onboarding flow.

Acceptance Criteria

Users must be able to create an organization during account setup without encountering errors or verification failures.

Purpose

To ensure that users can successfully create an organization during the account setup process without encountering errors, allowing for a smooth onboarding experience.

Requirements

Investigate the verification error that occurs when attempting to create an organization. Ensure that all necessary validation checks are properly handled to prevent errors during organization creation. Verify that the backend logic for organization creation is correctly implemented.

Expected Outcome

Users can create an organization without encountering any verification errors. The organization is successfully created and linked to the user’s account. A smooth and error-free onboarding flow is achieved, with users being redirected to their newly created organization page.

Screenshot 2024-08-21 at 21 47 20

johnson-oragui commented 4 weeks ago

@Promachi The bug arises from the frontend, when you click on register(a request is immediately sent to the backend with the new user details without waiting to send the fields for the user organisation, so the backend on receiving the user details would create an organisation for the user(at this point the backend assumes the user created an account without an organisation)), now when the user goes to the next screen and enters fields for organisation and clicks on create, at this point, there is no user to associate the organisation with, as the user had already been created with an organisation.

SOLUTION

The frontend should not send the a POST request to the backend during registration if the user ticked the create organisation box, the frontend should wait and send both the organisation fields and new user fields together in a single request, that way, the backend can associate and create an organisation for the new user with the provided fields.