Skip to content

Commit

Permalink
Merge pull request #95 from Team-Port/(#94)fix/detail
Browse files Browse the repository at this point in the history
(#94)fix/detail
  • Loading branch information
Xoeon authored Nov 25, 2023
2 parents 17b0b12 + f68fadc commit 41c7bbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/modules/apis/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export const useMyInfo = () => {
headers: {
Authorization: `Bearer ${token}`,
},
}).then((res) => res.data.data),
})
.then((res) => res.json())
.then((data) => data.data),
onError: (error) => {
return `An error has occurred: ${error.message}`;
},
Expand Down
10 changes: 4 additions & 6 deletions src/page/new-portal/Detail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { HOST_URL } from "../../lib/HostUrl";
import axios from "axios";
import { getJwtToken } from "../../modules/Auth";
import { useMyInfo } from "../../modules/apis/auth";
import Category from "../../component/ new-portal/Category";

const CommentBox = ({ activeId, handleActive, comment }) => {
const isActive = activeId === comment.id;
Expand Down Expand Up @@ -79,6 +80,7 @@ const Comment = ({ boardId, activeId, handleActive }) => {
const token = getJwtToken();

const { data: me } = useMyInfo();
console.log(me);

const { data: comments } = useQuery({
queryKey: [{ boardId }, "comment"],
Expand Down Expand Up @@ -252,12 +254,8 @@ const Detail = () => {
</div>
<div className="flex flex-col gap-[3px]">
<div className="flex flex-row justify-end gap-[10px]">
<div className="rounded-[50px] bg-[#85AED3] py-[1px] px-[8px] items-center min-w-[70px] flex justify-center text-sm font-semibold text-white">
{boardData.category1}
</div>
<div className="rounded-[50px] bg-[#EAB191] py-[1px] px-[8px] items-center min-w-[70px] flex justify-center text-sm font-semibold text-white">
{boardData.category2}
</div>
<Category category={boardData.category1} />
<Category category={boardData.category2} />
</div>
<div className="flex flex-row gap-[10px] items-center">
<div className="text-[#8F8F8F]">
Expand Down

0 comments on commit 41c7bbe

Please sign in to comment.