-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/#38-selfcare' into feature/path_refector
- Loading branch information
Showing
4 changed files
with
409 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { instance } from '../axios' | ||
|
||
interface T_Purpose { | ||
title: string | ||
content: string | ||
startDate: string | ||
endDate: string | ||
} | ||
|
||
export const monthPurposes = async (date: string) => { | ||
return await instance | ||
.get<Array<T_Purpose>>(`purposes/month/${date}`) | ||
.then(res => res.data) | ||
.catch((e): Array<T_Purpose> => { | ||
console.error( | ||
`%cAxios Error%c ${e.message}%c\n%O`, | ||
'background:rgb(148,71,68);padding:4px 8px;border-radius:8px;font-weight:900;font-size:18px;', | ||
'padding:40px 0;', | ||
'', | ||
e | ||
) | ||
// 이하는 더미데이터를 보내는 코드 입니다 | ||
return [ | ||
{ | ||
title: '타임라인 완성', | ||
content: '타임라인을 완성해요', | ||
startDate: '2024-03-22', | ||
endDate: '2024-03-29', | ||
}, | ||
{ | ||
title: '집에 도착', | ||
content: '집에 무사히 도착해요', | ||
startDate: '2024-03-22', | ||
endDate: '2024-03-23', | ||
}, | ||
] | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { instance } from '../axios' | ||
|
||
type DayOfWeeks = 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY' | ||
|
||
interface T_Routine { | ||
userInfo: { | ||
nickname: string | ||
profileImage: string | ||
} | ||
routineList: { | ||
id: number | ||
routine_name: string | ||
exercise_info_response_list: { | ||
pose: { | ||
id: number | ||
need_machine: boolean | ||
name: string | ||
simple_part: string[] | ||
exact_part: string[] | ||
thumbnail: string | ||
} | ||
repetitions: number | ||
sets: number | ||
}[] | ||
day_of_weeks: DayOfWeeks[] | ||
routine_status: { | ||
is_archived: boolean | ||
is_shared: boolean | ||
} | ||
}[] | ||
} | ||
|
||
export const monthRoutines = async () => { | ||
return await instance | ||
.get<T_Routine>('routines/me/all') | ||
.then(res => res.data) | ||
.catch((e): T_Routine => { | ||
console.error(e) | ||
|
||
// 이하는 더미데이터를 보내는 코드입니다 | ||
return { | ||
userInfo: { | ||
nickname: '박지민', | ||
profileImage: 'fileURL', | ||
}, | ||
routineList: [ | ||
{ | ||
id: 1, | ||
routine_name: '등 운동', | ||
exercise_info_response_list: [ | ||
{ | ||
pose: { | ||
id: 1, | ||
need_machine: false, | ||
name: '어떤 등운동', | ||
simple_part: ['등'], | ||
exact_part: ['등 위쪽'], | ||
thumbnail: '썸네일', | ||
}, | ||
repetitions: 20, | ||
sets: 3, | ||
}, | ||
{ | ||
pose: { | ||
id: 1, | ||
need_machine: false, | ||
name: '그런 등운동', | ||
simple_part: ['등'], | ||
exact_part: ['등 가운데'], | ||
thumbnail: '썸네일', | ||
}, | ||
repetitions: 15, | ||
sets: 5, | ||
}, | ||
{ | ||
pose: { | ||
id: 1, | ||
need_machine: false, | ||
name: '저런 등운동', | ||
simple_part: ['등'], | ||
exact_part: ['등 아래'], | ||
thumbnail: '썸네일', | ||
}, | ||
repetitions: 20, | ||
sets: 5, | ||
}, | ||
], | ||
day_of_weeks: ['MONDAY'], | ||
routine_status: { | ||
is_archived: true, | ||
is_shared: true, | ||
}, | ||
}, | ||
], | ||
} | ||
}) | ||
} |
Oops, something went wrong.