mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
fix: Handle NO_PROJECT_MARKER for projectRef (#51083)
Skip `NO_PROJECT_MARKER` values for projectRef in API validation.
This commit is contained in:
1 parent
c8b665caf2
commit
c5b4fbfa11
2 files changed
+5
-6
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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'],
|
||||
|
||||
Reference in new issue
Block a user