Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: Handle NO_PROJECT_MARKER for projectRef (#51083)

Kamil Ogórekc5b4fbfa1167
diff --git a/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx b/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx
index ed5626ec530..1ecaf94a24c 100644
--- a/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx
+++ b/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx
@@ -6,7 +6,7 @@ import { mockIntersectionObserver } from 'jsdom-testing-mocks'
import { http, HttpResponse } from 'msw'
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
-import { NO_ORG_MARKER, NO_PROJECT_MARKER } from '../SupportForm.utils'
+import { NO_PROJECT_MARKER } from '../SupportForm.utils'
import { SupportForm, SupportFormPage, SupportFormStatusButton } from '../SupportFormPage'
// End of third-party imports
@@ -753,7 +753,6 @@ describe('SupportFormPage', () => {
const payload = submitSpy.mock.calls[0]?.[0]
expect(payload).toMatchObject({
- projectRef: NO_PROJECT_MARKER,
organizationSlug: 'org-1',
allowSupportAccess: false,
})
@@ -1952,8 +1951,6 @@ describe('SupportFormPage', () => {
expect(payload).toMatchObject({
subject: 'Cannot access my account',
category: 'Dashboard_bug',
- projectRef: NO_PROJECT_MARKER,
- organizationSlug: NO_ORG_MARKER,
library: '',
affectedServices: '',
allowSupportAccess: false,
diff --git a/apps/studio/data/feedback/support-ticket-send.ts b/apps/studio/data/feedback/support-ticket-send.ts
index 941e0bebf0d..c46ea60a08c 100644
--- a/apps/studio/data/feedback/support-ticket-send.ts
+++ b/apps/studio/data/feedback/support-ticket-send.ts
@@ -4,6 +4,7 @@ import { toast } from 'sonner'
// End of third-party imports
import type { ExtendedSupportCategories } from '@/components/interfaces/Support/Support.constants'
+import { NO_ORG_MARKER, NO_PROJECT_MARKER } from '@/components/interfaces/Support/SupportForm.utils'
import { handleError, post } from '@/data/fetchers'
import { ResponseError } from '@/types'
import type { UseCustomMutationOptions } from '@/types'
@@ -55,8 +56,9 @@ export async function sendSupportTicket({
message,
category,
severity,
- projectRef,
- organizationSlug,
+ // Skip `NO_PROJECT_MARKER` values so we don't need to have special handling for it's value in API validation.
+ projectRef: projectRef === NO_PROJECT_MARKER ? undefined : projectRef,
+ organizationSlug: organizationSlug === NO_ORG_MARKER ? undefined : organizationSlug,
library,
verified: true,
tags: ['dashboard-support-form'],