@@ -357,7 +372,7 @@ export default function ResumeUploadForm({ vacancyId, vacancyTitle, onSuccess }:
- Откликнуться на вакансию
+ Откликнуться
{vacancyTitle}
@@ -459,14 +474,14 @@ export default function ResumeUploadForm({ vacancyId, vacancyTitle, onSuccess }:
name="resume_file"
type="file"
className="sr-only"
- accept=".pdf,.doc,.docx,.txt"
+ accept=".pdf,.docx"
onChange={handleFileChange}
/>
или перетащите сюда
- PDF, DOC, DOCX, TXT до 10 МБ
+ PDF, DOCX до 10 МБ
diff --git a/hooks/useSession.ts b/hooks/useSession.ts
index 7fe9904..9da45fe 100644
--- a/hooks/useSession.ts
+++ b/hooks/useSession.ts
@@ -39,4 +39,12 @@ export const useSessionHealth = () => {
staleTime: 2 * 60 * 1000, // 2 minutes
retry: 2,
})
+}
+
+export const useForceEndInterview = () => {
+ return useMutation({
+ mutationFn: (sessionId: number) => sessionService.forceEndInterview(sessionId),
+ retry: false, // Не повторяем запрос при ошибке
+ networkMode: 'always',
+ })
}
\ No newline at end of file
diff --git a/lib/ky-client.ts b/lib/ky-client.ts
index 76570f2..b314ba4 100644
--- a/lib/ky-client.ts
+++ b/lib/ky-client.ts
@@ -1,7 +1,6 @@
import ky from 'ky'
-// Используем прокси Next.js для избежания CORS проблем
-const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8000'
+const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8000/api'
// Базовый клиент без Content-Type заголовка
const baseKyClient = ky.create({
diff --git a/next.config.js b/next.config.js
index 32d4f41..0db6252 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,13 +1,4 @@
/** @type {import('next').NextConfig} */
-const nextConfig = {
- async rewrites() {
- return [
- {
- source: '/api/v1/:path*',
- destination: 'http://localhost:8000/api/v1/:path*',
- },
- ]
- },
-}
+const nextConfig = {}
module.exports = nextConfig
\ No newline at end of file
diff --git a/services/resume.service.ts b/services/resume.service.ts
index 8254bbb..451b2dc 100644
--- a/services/resume.service.ts
+++ b/services/resume.service.ts
@@ -21,17 +21,18 @@ export const resumeService = {
// Логируем данные для отладки
console.log('FormData entries:')
+ // @ts-ignore
for (const [key, value] of formData.entries()) {
console.log(key, value)
}
- return kyFormClient.post('api/v1/resumes/', {
+ return kyFormClient.post('v1/resumes/', {
body: formData,
}).json
()
},
async getResume(id: number): Promise {
- return kyClient.get(`api/v1/resumes/${id}`).json()
+ return kyClient.get(`v1/resumes/${id}`).json()
},
async getResumes(params?: GetResumesParams): Promise {
@@ -45,15 +46,15 @@ export const resumeService = {
})
}
- const endpoint = `api/v1/resumes/${searchParams.toString() ? `?${searchParams.toString()}` : ''}`
+ const endpoint = `v1/resumes/${searchParams.toString() ? `?${searchParams.toString()}` : ''}`
return kyClient.get(endpoint).json()
},
async validateInterview(resumeId: number): Promise<{ can_interview: boolean; message?: string }> {
- return kyClient.get(`api/v1/interview/${resumeId}/validate-interview`).json()
+ return kyClient.get(`v1/interview/${resumeId}/validate-interview`).json()
},
- async getInterviewToken(resumeId: number): Promise<{ token: string; roomName: string; serverUrl: string }> {
- return kyClient.post(`api/v1/interview/${resumeId}/token`).json()
+ async getInterviewToken(resumeId: number): Promise<{ token: string; roomName: string; serverUrl: string; session_id: number }> {
+ return kyClient.post(`v1/interview/${resumeId}/token`).json()
},
}
\ No newline at end of file
diff --git a/services/session.service.ts b/services/session.service.ts
index f2b4e2a..ec015f1 100644
--- a/services/session.service.ts
+++ b/services/session.service.ts
@@ -3,18 +3,22 @@ import { SessionRead } from '@/types/api'
export const sessionService = {
async getCurrentSession(): Promise {
- return kyClient.get('api/v1/sessions/current').json()
+ return kyClient.get('v1/sessions/current').json()
},
async refreshSession(): Promise {
- return kyClient.post('api/v1/sessions/refresh').json()
+ return kyClient.post('v1/sessions/refresh').json()
},
async logout(): Promise {
- return kyClient.post('api/v1/sessions/logout').json()
+ return kyClient.post('v1/sessions/logout').json()
},
async healthCheck(): Promise {
- return kyClient.get('api/v1/sessions/health').json()
+ return kyClient.get('v1/sessions/health').json()
+ },
+
+ async forceEndInterview(sessionId: number): Promise {
+ return kyClient.post(`v1/admin/interview/${sessionId}/force-end`).json()
},
}
\ No newline at end of file
diff --git a/services/vacancy.service.ts b/services/vacancy.service.ts
index ac7d060..c33a93f 100644
--- a/services/vacancy.service.ts
+++ b/services/vacancy.service.ts
@@ -13,11 +13,11 @@ export const vacancyService = {
})
}
- const endpoint = `api/v1/vacancies/${searchParams.toString() ? `?${searchParams.toString()}` : ''}`
+ const endpoint = `v1/vacancies/${searchParams.toString() ? `?${searchParams.toString()}` : ''}`
return kyClient.get(endpoint).json()
},
async getVacancy(id: number): Promise {
- return kyClient.get(`api/v1/vacancies/${id}`).json()
+ return kyClient.get(`v1/vacancies/${id}`).json()
},
}
\ No newline at end of file