Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite --port 5174 --host",
"dev": "vite --port 3000",
"build": "vite build && tsc",
"preview": "vite preview",
"test": "vitest run",
Expand Down Expand Up @@ -65,4 +65,4 @@
"vitest": "^4.0.18",
"web-vitals": "^5.1.0"
}
}
}
1 change: 0 additions & 1 deletion src/api/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export interface Form {
updatedAt?: string // Last update timestamp
fields?: Array<FormField> // Associated form fields (optional)
responseCount?: number // Number of submissions received
draftCount?: number // Number of draft saves
}

// Standard API response wrapper for consistent error handling
Expand Down
14 changes: 2 additions & 12 deletions src/api/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ async function handleResponse<T>(response: Response): Promise<T> {
console.error('Response Text:', response.statusText)
throw new Error(
errorData.message ||
errorData.error ||
`Request failed: ${response.statusText}`,
errorData.error ||
`Request failed: ${response.statusText}`,
)
}
const result: ApiResponse<T> = await response.json()
Expand Down Expand Up @@ -129,14 +129,4 @@ export const responsesApi = {
})
return handleResponse<Array<UserResponse>>(response)
},

// GET /responses/received - Get all responses RECEIVED for forms owned by the user
getAllReceived: async (): Promise<Array<any>> => {
const response = await fetch(`${API_URL}/responses/received`, {
method: 'GET',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
})
return handleResponse<Array<any>>(response)
},
}
163 changes: 0 additions & 163 deletions src/lib/mock-data.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { Route as LayoutEditorIndexRouteImport } from './routes/_layout.editor.i
import { Route as LayoutAnalyticsIndexRouteImport } from './routes/_layout.analytics.index'
import { Route as LayoutEditorFormIdRouteImport } from './routes/_layout.editor.$formId'
import { Route as LayoutAnalyticsResponsesRouteImport } from './routes/_layout.analytics.responses'
import { Route as LayoutAnalyticsReportsRouteImport } from './routes/_layout.analytics.reports'

const SignupRoute = SignupRouteImport.update({
id: '/signup',
Expand Down Expand Up @@ -89,11 +88,6 @@ const LayoutAnalyticsResponsesRoute =
path: '/responses',
getParentRoute: () => LayoutAnalyticsRoute,
} as any)
const LayoutAnalyticsReportsRoute = LayoutAnalyticsReportsRouteImport.update({
id: '/reports',
path: '/reports',
getParentRoute: () => LayoutAnalyticsRoute,
} as any)

export interface FileRoutesByFullPath {
'/': typeof IndexRoute
Expand All @@ -104,7 +98,6 @@ export interface FileRoutesByFullPath {
'/dashboard': typeof LayoutDashboardRoute
'/my-responses': typeof LayoutMyResponsesRoute
'/form/$formId': typeof FormFormIdRoute
'/analytics/reports': typeof LayoutAnalyticsReportsRoute
'/analytics/responses': typeof LayoutAnalyticsResponsesRoute
'/editor/$formId': typeof LayoutEditorFormIdRoute
'/analytics/': typeof LayoutAnalyticsIndexRoute
Expand All @@ -118,7 +111,6 @@ export interface FileRoutesByTo {
'/dashboard': typeof LayoutDashboardRoute
'/my-responses': typeof LayoutMyResponsesRoute
'/form/$formId': typeof FormFormIdRoute
'/analytics/reports': typeof LayoutAnalyticsReportsRoute
'/analytics/responses': typeof LayoutAnalyticsResponsesRoute
'/editor/$formId': typeof LayoutEditorFormIdRoute
'/analytics': typeof LayoutAnalyticsIndexRoute
Expand All @@ -135,7 +127,6 @@ export interface FileRoutesById {
'/_layout/dashboard': typeof LayoutDashboardRoute
'/_layout/my-responses': typeof LayoutMyResponsesRoute
'/form/$formId': typeof FormFormIdRoute
'/_layout/analytics/reports': typeof LayoutAnalyticsReportsRoute
'/_layout/analytics/responses': typeof LayoutAnalyticsResponsesRoute
'/_layout/editor/$formId': typeof LayoutEditorFormIdRoute
'/_layout/analytics/': typeof LayoutAnalyticsIndexRoute
Expand All @@ -152,7 +143,6 @@ export interface FileRouteTypes {
| '/dashboard'
| '/my-responses'
| '/form/$formId'
| '/analytics/reports'
| '/analytics/responses'
| '/editor/$formId'
| '/analytics/'
Expand All @@ -166,7 +156,6 @@ export interface FileRouteTypes {
| '/dashboard'
| '/my-responses'
| '/form/$formId'
| '/analytics/reports'
| '/analytics/responses'
| '/editor/$formId'
| '/analytics'
Expand All @@ -182,7 +171,6 @@ export interface FileRouteTypes {
| '/_layout/dashboard'
| '/_layout/my-responses'
| '/form/$formId'
| '/_layout/analytics/reports'
| '/_layout/analytics/responses'
| '/_layout/editor/$formId'
| '/_layout/analytics/'
Expand Down Expand Up @@ -291,24 +279,15 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAnalyticsResponsesRouteImport
parentRoute: typeof LayoutAnalyticsRoute
}
'/_layout/analytics/reports': {
id: '/_layout/analytics/reports'
path: '/reports'
fullPath: '/analytics/reports'
preLoaderRoute: typeof LayoutAnalyticsReportsRouteImport
parentRoute: typeof LayoutAnalyticsRoute
}
}
}

interface LayoutAnalyticsRouteChildren {
LayoutAnalyticsReportsRoute: typeof LayoutAnalyticsReportsRoute
LayoutAnalyticsResponsesRoute: typeof LayoutAnalyticsResponsesRoute
LayoutAnalyticsIndexRoute: typeof LayoutAnalyticsIndexRoute
}

const LayoutAnalyticsRouteChildren: LayoutAnalyticsRouteChildren = {
LayoutAnalyticsReportsRoute: LayoutAnalyticsReportsRoute,
LayoutAnalyticsResponsesRoute: LayoutAnalyticsResponsesRoute,
LayoutAnalyticsIndexRoute: LayoutAnalyticsIndexRoute,
}
Expand Down
Loading