feat: initialize frontend with React, Vite, and Tailwind CSS
- Added package.json for project dependencies and scripts. - Configured PostCSS with Tailwind CSS. - Created main application structure with App component and routing. - Implemented API client for handling requests with Axios. - Developed authentication API for login, logout, and user verification. - Created entities API for managing virtual entities. - Implemented logs API for fetching dispatch logs. - Added navigation bar component for app navigation. - Created protected route component for route guarding. - Set up global CSS with Tailwind directives. - Configured main entry point for React application. - Developed basic Dashboard and Login pages. - Set up router for application navigation. - Added Jest testing setup for testing library. - Configured Tailwind CSS with content paths. - Set TypeScript configuration for frontend. - Created Vite configuration for development and production builds. - Added Nginx configuration for serving the application and proxying API requests.
This commit is contained in:
27
frontend/src/api/logsApi.ts
Normal file
27
frontend/src/api/logsApi.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import apiClient from './apiClient'
|
||||
|
||||
export type DispatchStatus = 'PENDING' | 'SENT' | 'FAILED'
|
||||
|
||||
export interface DispatchLogResponse {
|
||||
id: string
|
||||
entityId: string
|
||||
promptSent: string
|
||||
aiResponse: string
|
||||
emailSubject: string
|
||||
emailBody: string
|
||||
status: DispatchStatus
|
||||
errorMessage: string | null
|
||||
dispatchedAt: string
|
||||
}
|
||||
|
||||
/** GET /api/v1/dispatch-logs — list all dispatch logs. */
|
||||
export async function getLogs(): Promise<DispatchLogResponse[]> {
|
||||
const response = await apiClient.get<DispatchLogResponse[]>('/v1/dispatch-logs')
|
||||
return response.data
|
||||
}
|
||||
|
||||
/** GET /api/v1/dispatch-logs/entity/:id — list logs for a specific entity. */
|
||||
export async function getLogsByEntity(entityId: string): Promise<DispatchLogResponse[]> {
|
||||
const response = await apiClient.get<DispatchLogResponse[]>(`/v1/dispatch-logs/entity/${entityId}`)
|
||||
return response.data
|
||||
}
|
||||
Reference in New Issue
Block a user