Skip to content

Commit

Permalink
feat: 추첨 API 연동
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj2713 committed Aug 16, 2024
1 parent 265fd51 commit 8d02920
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 69 deletions.
63 changes: 0 additions & 63 deletions admin/src/apis/lotteryAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const LotteryAPI = {
},
async postLotteryWinner(token: string): Promise<PostLotteryWinnerResponse> {
try {
return new Promise((resolve) => resolve({ message: "요청에 성공하였습니다." }));
const response = await fetchWithTimeout(`${baseURL}/winner`, {
method: "POST",
headers: { ...headers, Authorization: `Bearer ${token}` },
Expand Down Expand Up @@ -97,68 +96,6 @@ export const LotteryAPI = {
token: string
): Promise<GetLotteryExpectationsResponse> {
try {
return new Promise((resolve) =>
resolve({
expectations: [
{
casperId: 1,
expectation: "기대평 1",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 2,
expectation: "기대평 2",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 3,
expectation: "기대평 3",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 1,
expectation: "기대평 1",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 2,
expectation: "기대평 2",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 3,
expectation: "기대평 3",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 1,
expectation: "기대평 1",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 2,
expectation: "기대평 2",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
{
casperId: 3,
expectation: "기대평 3",
createdDate: "2024-08-15",
createdTime: "22:00:00",
},
],
isLastPage: false,
totalExpectations: 100,
})
);
const response = await fetchWithTimeout(
`${baseURL}/participants/${participantId}/expectations?page=${page}&size=${size}`,
{
Expand Down
6 changes: 0 additions & 6 deletions admin/src/pages/LotteryWinnerList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default function LotteryWinnerList() {
const { handleOpenModal, ModalComponent } = useModal();

const [selectedWinnerId, setSelectedWinnerId] = useState<number>(0);
const [selectedExpectations, setSelectedExpectations] = useState<LotteryExpectationsType[]>([]);
const phoneNumberRef = useRef<string>("");
const phoneNumberInputRef = useRef<HTMLInputElement>(null);

Expand Down Expand Up @@ -97,11 +96,6 @@ export default function LotteryWinnerList() {
useEffect(() => {
refetchLotteryExpectation();
}, [selectedWinnerId]);
useEffect(() => {
if (expectation && isSuccessGetLotteryExpectation) {
setSelectedExpectations(expectation);
}
}, [expectation, isSuccessGetLotteryExpectation]);
useEffect(() => {
if (isSuccessGetLotteryExpectation) {
showToast();
Expand Down

0 comments on commit 8d02920

Please sign in to comment.