Skip to content

Commit

Permalink
chore: 불필요 api client 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyong9169 committed Aug 5, 2024
1 parent 1dfb19b commit 10b84ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
19 changes: 6 additions & 13 deletions apps/web/src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ import { EventApi } from "./event-api";
import { PhraseApi } from "./phrase-api";

const onRequestSuccess = (requestInit: RequestInit): RequestInit => {
if (typeof window !== "undefined" && requestInit.headers) {
const copyRequestInit: RequestInit = JSON.parse(
JSON.stringify(requestInit),
);
copyRequestInit.headers = {
...copyRequestInit.headers,
Authorization: "Bearer ",
};
return copyRequestInit;
}
// server side getCookie logic
console.log("server side");
return requestInit;
const copyRequestInit: RequestInit = JSON.parse(JSON.stringify(requestInit));
copyRequestInit.headers = {
...copyRequestInit.headers,
Authorization: "Bearer ",
};
return copyRequestInit;
};

const onResponseError: OnResponseError<
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/components/event-participant-floating-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { apis } from "~/apis";
const EventParticipantFloatingButton = () => {
const [isLoading, setIsLoading] = useState(true);
const [eventList, setEventList] = useState<Array<Prize>>([]);
const eventMainItem = eventList?.[0];

const getPrizeList = async () => {
const res = await apis.eventApi.getPrizeList();
Expand All @@ -20,7 +19,9 @@ const EventParticipantFloatingButton = () => {
getPrizeList();
}, []);

if (isLoading || !("totalParticipantCount" in eventMainItem)) return null;
if (isLoading) return null;
const eventMainItem = eventList[0];
if (!("totalParticipantCount" in eventMainItem)) return null;
return (
<div className="w-fit bg-[#ffffff] py-[5px] px-[12px] rounded-[20px] border-[1px] border-solid border-[#FF7900] shadow-[0_4px_10px_0px_#0000001A]">
<span className="text-[16px] font-semibold leading-[19.2px] whitespace-pre-wrap">
Expand Down

0 comments on commit 10b84ae

Please sign in to comment.