-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #239 from bankidz/refactor/reactQuery
Refactor/react query
- Loading branch information
Showing
14 changed files
with
201 additions
and
113 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
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,11 @@ | ||
import { axiosPrivateTemp } from '../axios'; | ||
import { IDongilDTO } from './challengeDTO'; | ||
|
||
const challengeAPI = { | ||
getChallenge: async (): Promise<IDongilDTO> => { | ||
const response = await axiosPrivateTemp.get('/challenge/progress'); | ||
return response.data; | ||
}, | ||
}; | ||
|
||
export default challengeAPI; |
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,32 @@ | ||
import { TDongilCategory } from '@lib/types/TDongilCategory'; | ||
import { TDongilStatus } from '@lib/types/TDongilStatus'; | ||
import { TItemName } from '@lib/types/TItemName'; | ||
|
||
export interface IProgressDTO { | ||
approvedAt: string; | ||
challengeId: number; | ||
challengeStatus: TDongilStatus; | ||
isAchieved: boolean; | ||
weeks: number; | ||
} | ||
|
||
export interface IDongilDTO { | ||
challengeCategory: string; | ||
challengeStatus: TDongilStatus; | ||
comment: { | ||
content: string; | ||
id: number; | ||
}; | ||
createdAt: string; | ||
fileName: string; | ||
interestPrice: number; | ||
interestRate: number; | ||
isMom: boolean; | ||
itemName: TItemName; | ||
progressList: IDongilDTO[]; | ||
successWeeks: number; | ||
title: string; | ||
totalPrice: number; | ||
weekPrice: number; | ||
weeks: number; | ||
} |
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,11 @@ | ||
import { axiosPublic } from '../axios'; | ||
import { ILoginDTO } from './kakaoDTO'; | ||
|
||
const kakaoAPI = { | ||
login: async (code: string): Promise<ILoginDTO> => { | ||
const response = await axiosPublic.post('/kakao/login', code); | ||
return response.data.data; | ||
}, | ||
}; | ||
|
||
export default kakaoAPI; |
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,8 @@ | ||
import { TLevel } from '@lib/types/TLevel'; | ||
|
||
export interface ILoginDTO { | ||
accessToken: string; | ||
isKid: boolean; | ||
level: TLevel; | ||
provider: string; | ||
} |
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
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 |
---|---|---|
@@ -1,14 +1,29 @@ | ||
const queryKeys = { | ||
FAMILY: 'family', | ||
FAMILY_KID: 'family_kid', | ||
|
||
USER: 'user', | ||
USER_OPTIN: 'user_optIn', | ||
|
||
NOTICE: 'notice', | ||
|
||
NOTIFICATION: 'notification', | ||
NOTIFICATION_IS_READ: 'notification_isRead', | ||
/** apple-controller */ | ||
APPLE_LOGIN: '/apple/login', | ||
APPLE_REVOKE: '/apple/revoke', | ||
/** challenge-controller */ | ||
CHALLENGE: '/challenge', | ||
CHALLENGE_ACHIEVED: '/challenge/achieved', | ||
CHALLENGE_KID: '/challenge/kid', | ||
CHALLENGE_KID_ACHIEVED: '/challenge/kid/achieved', | ||
CHALLENGE_KID_PROGRESS: '/challenge/kid/progress', | ||
CHALLENGE_PROGRESS: '/challenge/progress', | ||
/** family-controller */ | ||
FAMILY: '/family', | ||
FAMILY_KID: '/family_kid', | ||
/** health-check-controller */ | ||
HEALTH: '/health', | ||
/** notice-controller */ | ||
NOTICE: '/notice', | ||
/** notification-controller */ | ||
NOTIFICATION: '/notification', | ||
NOTIFICATION_IS_READ: '/notification_isRead', | ||
/** s-3-controller */ | ||
S3_URL: '/s3/url', | ||
/** user-controller */ | ||
USER: '/user', | ||
USER_OPTIN: '/user_optIn', | ||
}; | ||
|
||
export default queryKeys; |
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
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
Oops, something went wrong.