fix: responses publish (#2756)

This commit is contained in:
Dhruwang Jariwala
2024-06-11 18:40:56 +05:30
committed by GitHub
parent 70e77247f6
commit a382a18d44
3 changed files with 15 additions and 19 deletions

View File

@@ -1,7 +1,6 @@
import { SurveyAnalysisNavigation } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/SurveyAnalysisNavigation";
import { ResponsePage } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponsePage";
import { notFound } from "next/navigation";
import { RESPONSES_PER_PAGE, WEBAPP_URL } from "@formbricks/lib/constants";
import { getEnvironment } from "@formbricks/lib/environment/service";
import { getProductByEnvironmentId } from "@formbricks/lib/product/service";
@@ -17,17 +16,16 @@ const Page = async ({ params }) => {
if (!surveyId) {
return notFound();
}
const [survey, environment, product, tags] = await Promise.all([
getSurvey(params.surveyId),
getEnvironment(params.environmentId),
getProductByEnvironmentId(params.environmentId),
getTagsByEnvironmentId(params.environmentId),
]);
const survey = await getSurvey(surveyId);
if (!survey) {
throw new Error("Survey not found");
}
const environmentId = survey.environmentId;
const [environment, product, tags] = await Promise.all([
getEnvironment(environmentId),
getProductByEnvironmentId(environmentId),
getTagsByEnvironmentId(environmentId),
]);
if (!environment) {
throw new Error("Environment not found");
@@ -45,7 +43,7 @@ const Page = async ({ params }) => {
<SurveyAnalysisNavigation
surveyId={survey.id}
environmentId={environment.id}
activeId="summary"
activeId="responses"
responseCount={totalResponseCount}
/>
</PageHeader>

View File

@@ -1,7 +1,6 @@
import { SurveyAnalysisNavigation } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/SurveyAnalysisNavigation";
import { SummaryPage } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage";
import { notFound } from "next/navigation";
import { getAttributeClasses } from "@formbricks/lib/attributeClass/service";
import { WEBAPP_URL } from "@formbricks/lib/constants";
import { getEnvironment } from "@formbricks/lib/environment/service";
@@ -18,16 +17,16 @@ const Page = async ({ params }) => {
return notFound();
}
const [survey, environment, attributeClasses, product] = await Promise.all([
getSurvey(params.surveyId),
getEnvironment(params.environmentId),
getAttributeClasses(params.environmentId),
getProductByEnvironmentId(params.environmentId),
]);
const survey = await getSurvey(surveyId);
if (!survey) {
throw new Error("Survey not found");
}
const environmentId = survey.environmentId;
const [environment, attributeClasses, product] = await Promise.all([
getEnvironment(environmentId),
getAttributeClasses(environmentId),
getProductByEnvironmentId(environmentId),
]);
if (!environment) {
throw new Error("Environment not found");

View File

@@ -1,5 +1,4 @@
import Link from "next/link";
import { cn } from "@formbricks/lib/cn";
interface SecondaryNavbarProps {