fix: onboarding issues (#2373)

Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
This commit is contained in:
Dhruwang Jariwala
2024-04-05 02:56:09 +05:30
committed by GitHub
parent 9e06dde2fc
commit 9f7cb7c1b9
7 changed files with 39 additions and 19 deletions
@@ -21,6 +21,7 @@ import {
getMonthlyTeamResponseCount,
getTeamByEnvironmentId,
} from "@formbricks/lib/team/service";
import { updateUser } from "@formbricks/lib/user/service";
import { isVersionGreaterThanOrEqualTo } from "@formbricks/lib/utils/version";
import { TLegacySurvey } from "@formbricks/types/LegacySurvey";
import { TEnvironment } from "@formbricks/types/environment";
@@ -75,6 +76,7 @@ export async function GET(
const firstSurvey = getExampleSurveyTemplate(WEBAPP_URL);
await createSurvey(environmentId, firstSurvey);
await updateEnvironment(environment.id, { widgetSetupCompleted: true });
await updateUser(userId, { onboardingCompleted: true });
}
// check team subscriptions
const team = await getTeamByEnvironmentId(environmentId);