Skip to content

Commit 89744c0

Browse files
committed
fix: ensure support feedback follows codebase standards
1 parent ca0dd22 commit 89744c0

File tree

1 file changed

+5
-11
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/support/apis

1 file changed

+5
-11
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/support/apis/feedback.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,18 @@ export async function submitSupportFeedback(
3131
const input = parsed.data;
3232

3333
try {
34-
if (!NEXT_PUBLIC_DASHBOARD_CLIENT_ID) {
35-
return { error: "NEXT_PUBLIC_DASHBOARD_CLIENT_ID not configured" };
36-
}
37-
38-
if (!NEXT_PUBLIC_THIRDWEB_API_HOST) {
39-
return { error: "NEXT_PUBLIC_THIRDWEB_API_HOST not configured" };
40-
}
34+
// Use fallback client ID if not configured (following codebase pattern)
35+
const clientId = NEXT_PUBLIC_DASHBOARD_CLIENT_ID || "dummy-build-client";
36+
const vercelEnv = getVercelEnv();
37+
const isPreview = vercelEnv === "preview" || vercelEnv === "development";
4138

4239
const response = await fetch(
4340
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/csat/saveCSATFeedback`,
4441
{
4542
method: "POST",
4643
headers: {
4744
"Content-Type": "application/json",
48-
"x-service-api-key": NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
45+
"x-service-api-key": clientId,
4946
},
5047
body: JSON.stringify({
5148
rating: input.rating,
@@ -56,9 +53,6 @@ export async function submitSupportFeedback(
5653
);
5754

5855
if (!response.ok) {
59-
// Check if we're in a preview environment (Vercel preview deployments)
60-
const vercelEnv = getVercelEnv();
61-
const isPreview = vercelEnv === "preview" || vercelEnv === "development";
6256
if (response.status === 404 && isPreview) {
6357
// Only in preview/dev, simulate success if the endpoint isn't deployed yet
6458
console.debug(

0 commit comments

Comments
 (0)