Skip to content

Commit

Permalink
💩 : #63 - api hook과 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
suehdn committed Nov 17, 2023
1 parent 26cafb8 commit 25307ff
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
12 changes: 12 additions & 0 deletions src/apis/client/getAllPlans.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { axiosInstanceClient } from '../axiosInstanceClient';

export const getAllPlans = async () => {
try {
const { data } = await axiosInstanceClient.get('/plans', {
authorization: false,
});
return data;
} catch (error) {
console.log('Error:', error);
}
};
13 changes: 13 additions & 0 deletions src/apis/server/getMyPlans.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { GetMyPlansResponse } from '@/types/apis/plan/GetMyPlans';
import { axiosInstanceServer } from '@apis/axiosInstanceServer';

export const getMyPlans = async (userId: string) => {
try {
const { data } = await axiosInstanceServer.get<GetMyPlansResponse>(
`/plans/main/${userId}`,
);
return data;
} catch (error) {
console.log('Error:', error);
}
};
13 changes: 0 additions & 13 deletions src/hooks/apis/plans/useAllPlansQuery.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/hooks/apis/plans/useMyPlansQuery.ts

This file was deleted.

0 comments on commit 25307ff

Please sign in to comment.