Skip to content

Commit

Permalink
Feature/#130 curriculum api 수정 (#135)
Browse files Browse the repository at this point in the history
* feat : 커리큘럼 api 수정

* feat : 변수명 변경
  • Loading branch information
mun-kyeong authored Mar 22, 2024
1 parent 765b671 commit e000e15
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/app/api/curriculumItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { fetcher } from '@/app/api/fetcher';
import { CurriculumItemsDto } from '@/types';

const curriculumFetcher = fetcher();

const postCurriculumFetch = (studyId: number, curriculum: CurriculumItemsDto) => {
curriculumFetcher(`/studies/${studyId}/curriculums`, {
method: 'POST',
body: curriculum,
});
};

const patchCurriculumFetch = (curriculumId: number, ParticipantId: number) => {
curriculumFetcher(`/curriculums/${curriculumId}/${ParticipantId}/check`, {
method: 'PATCH',
});
};

export { postCurriculumFetch, patchCurriculumFetch };
17 changes: 17 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,20 @@ export interface EditTeamDto {
name: string;
description: string;
}

export interface CurriculumDto {
createdAt: string;
updatedAt: string;
id: number;
name: string;
itemOrder: number;
isDeleted: boolean;
study: string;
participantCurriculumItems: CurriculumItemDto[];
}

export interface CurriculumItemsDto {
curriculumItems: CurriculumDto[];
deletedCurriculumItems: CurriculumDto[];
participantCurriculumItems: CurriculumDto[];
}

0 comments on commit e000e15

Please sign in to comment.