|
1 | 1 | 'use server' |
2 | 2 |
|
3 | | -import { getBusinessSession, getTeacherSession } from 'entities/auth' |
4 | | -import { apiClient, Pagination, PaginationParams } from 'shared/api' |
| 3 | +import { getBusinessSession } from 'entities/auth' |
| 4 | +import { apiClient } from 'shared/api' |
5 | 5 |
|
6 | | -import { JobPostRelation } from '../model/application' |
7 | | -import { ApplicationStatus } from '../model/status' |
| 6 | +import { JobPostRelationDetail } from '../model/application' |
8 | 7 |
|
9 | | -export type GetJobPostResumeRequest = PaginationParams<{ |
10 | | - status?: ApplicationStatus |
11 | | -}> |
12 | | - |
13 | | -type GetJobPostResumeResponse = Pagination<JobPostRelation> |
14 | | - |
15 | | -export const getTeacherJobPostResumeRelations = async ( |
16 | | - queryParams: GetJobPostResumeRequest, |
17 | | -) => { |
18 | | - const { accessToken } = await getTeacherSession() |
19 | | - |
20 | | - const response = await apiClient.get<GetJobPostResumeResponse>({ |
21 | | - endpoint: '/job-post-resume-relations', |
22 | | - queryParams, |
23 | | - option: { |
24 | | - authorization: `Bearer ${accessToken}`, |
25 | | - }, |
26 | | - }) |
27 | | - |
28 | | - return response |
| 8 | +export type GetJobPostResumeRequest = { |
| 9 | + jobPostResumeRelationId: number |
29 | 10 | } |
30 | 11 |
|
31 | | -export const getBusinessJobPostResumeRelations = async ( |
32 | | - queryParams: GetJobPostResumeRequest, |
33 | | -) => { |
| 12 | +type GetJobPostResumeResponse = JobPostRelationDetail |
| 13 | + |
| 14 | +export const getBusinessJobPostResumeRelation = async ({ |
| 15 | + jobPostResumeRelationId, |
| 16 | +}: GetJobPostResumeRequest) => { |
34 | 17 | const { accessToken } = await getBusinessSession() |
35 | 18 |
|
36 | 19 | const response = await apiClient.get<GetJobPostResumeResponse>({ |
37 | | - endpoint: '/job-post-resume-relations', |
38 | | - queryParams, |
| 20 | + endpoint: `/job-post-resume-relations/${jobPostResumeRelationId}`, |
39 | 21 | option: { |
40 | 22 | authorization: `Bearer ${accessToken}`, |
41 | 23 | }, |
|
0 commit comments