Skip to content

Commit

Permalink
fix : 빌드 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ohsuhyeon0119 committed Jan 25, 2024
1 parent ec3bf82 commit d546ddb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
23 changes: 0 additions & 23 deletions src/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function ContentPanel({
setContent: (content: MovieType) => void;

refetch: () => void;

}) {
const [currentModal, setCurrentModal] = useState<
"updateComment" | "createComment" | null
Expand All @@ -69,12 +68,10 @@ function ContentPanel({

const [myState, setMyState] = useState<MyStateResType | null>(
content.my_state ?? null

);
const setMyStateHandler = (targetState: MyStateType) => {
if (!accessToken) return;
if (content.my_state === null && targetState !== null)

return postCreateWatchingState(content.movieCD, accessToken, targetState)
.then(defaultResponseHandler)
.then((myState) => {
Expand All @@ -93,18 +90,6 @@ function ContentPanel({
);
};


return putUpdateWatchingState(
content.movieCD,
accessToken,
targetState
).then((res) => {
if (!res.ok) {
throw new Error("잘못된 요청입니다");
}
setMyState(targetState);
});
};
return (
<section className={styles.panelBackground}>
<div className={styles.panelCon}>
Expand Down Expand Up @@ -134,9 +119,7 @@ function ContentPanel({
<ul className={styles.reviewMenuCon}>
<li
onClick={() => {

myState?.user_state === "want_to_watch"

? setMyStateHandler(null)
: setMyStateHandler("want_to_watch");
}}
Expand All @@ -146,11 +129,9 @@ function ContentPanel({
aria-hidden="true"
viewBox="0 0 24 24"
className={

myState?.user_state === "want_to_watch"
? styles.checked
: ""

}
>
<path d="M20.5 13.093h-7.357V20.5h-2.286v-7.407H3.5v-2.286h7.357V3.5h2.286v7.307H20.5v2.286Z"></path>
Expand All @@ -174,9 +155,7 @@ function ContentPanel({
</li>
<li
onClick={() => {

myState?.user_state === "watching"

? setMyStateHandler(null)
: setMyStateHandler("watching");
}}
Expand All @@ -185,11 +164,9 @@ function ContentPanel({
<svg
aria-hidden="true"
viewBox="0 0 24 24"

className={
myState?.user_state === "watching" ? styles.checked : ""
}

>
<path d="M12 5C7 5 2.73 8.11 1 12.5 2.73 16.89 7 20 12 20s9.27-3.11 11-7.5C21.27 8.11 17 5 12 5Zm0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5Zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3Z"></path>
</svg>
Expand Down
29 changes: 0 additions & 29 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,6 @@ export default function Header({ setCurrentModal }: HeaderProps) {
<header
className={styles.header + (transparent ? " " + styles.transparent : "")}
>
<button
onClick={() => {
fetch("https://wafflepedia.xyz/auth/token/", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(jsonData),
credentials: "include",
})
.then((response) => {
if (!response.ok) {
console.log(response.status);
// throw new Error(
// `Network response was not ok: ${response.status}`,
// );
}
return response.json(); // JSON 형식으로 파싱
})
.then((data) => {
console.log("Response body:", data);
})
.catch((err) => {
console.log(err);
});
}}
>
api연결
</button>
<div>
<div className={styles.headerDiv}>
<ul>
Expand Down

0 comments on commit d546ddb

Please sign in to comment.