Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hyuna committed Jul 29, 2024
2 parents 9a82813 + 9bd9835 commit 2ca387a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
1 change: 1 addition & 0 deletions src/api/bug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const BugPost = () => {
await instance.post(`/bug/message`, {
title: param.title,
content: param.content,
model: "WEB",
file_name: param.file_name,
});
} catch (error) {
Expand Down
38 changes: 14 additions & 24 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,30 @@ refreshInstance.interceptors.request.use(

instance.interceptors.response.use(
(response) => response,
async (error: AxiosError<AxiosError>) => {
async (error: AxiosError) => {
if (axios.isAxiosError(error) && error.response) {
const { status } = error.response.data;
const { status } = error.response;
if (status === 401) {
const refreshToken = cookie.get("refresh_token");
if (refreshToken) {
try {
const res = await axios.put(
`${BASEURL}/refresh`,
{},
{
await axios
.put(`${BASEURL}/admin/refresh`, null, {
headers: {
"X-Refresh-Token": `Bearer ${refreshToken}`,
"X-Refresh-Token": `${refreshToken}`,
},
}
);
const { data } = res.data;
const accessToken = data.accessToken;
cookie.set("access_token", accessToken);
if (error.config) {
error.config.headers.Authorization = `Bearer ${accessToken}`;
return axios.request(error.config);
}
} catch {
throw error;
})
.then((response) => {
const data = response.data;
cookie.set("access_token", data.access_token);
cookie.set("refresh_token", data.refresh_token);
});
} catch (refreshError) {
return Promise.reject(refreshError);
}
} else {
throw error;
}
} else {
throw error;
}
} else {
throw error;
}
return Promise.reject(error);
}
);
9 changes: 6 additions & 3 deletions src/components/dropdown/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ const AfterCheck: React.FC<AfterCheckProp> = ({ state, onChange, type }) => {
case "외출":
return "border border-primary-500 text-primary-500";
case "이동":
return "border border border-tertiary-300 text-tertiary-300";
return "border border-tertiary-300 text-tertiary-300";
case "취업":
case "현체":
return "border border-neutral-500 text-neutral-500";
default:
return "";
}
Expand Down Expand Up @@ -75,9 +78,9 @@ const AfterCheck: React.FC<AfterCheckProp> = ({ state, onChange, type }) => {
setIsDropdownVisible(false);
};

return state === "현체" ? (
return state === "현체" || state === "취업" ? (
<div
className={`w-full h-max px-4 py-1 text-label1 text-neutral-400 rounded-lg bg-white`}
className={`box-border group px-4 py-1 bg-white rounded-lg text-Button-ES fle x justify-between items-center ${style()}`}
>
{selectedOption}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/checkPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const CheckPage = ({ type }: checkPageType) => {
{type === "outGoing" ? (
<div className=" rounded-xl w-full h-62 bg-white flex flex-col items-center gap-3 py-6">
<div className=" text-neutral-50 text-sub-title4-M text-center px-3">
현재 외출 중인 학생은 총
현재 외출/조기귀가 중인 학생은 총
<span className=" text-primary-500">{list.out}</span>입니다.
</div>
<Image src={outGoingImg} alt="" />
Expand Down

0 comments on commit 2ca387a

Please sign in to comment.