-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1047 from academic-relations/dev
merge dev into main
- Loading branch information
Showing
13 changed files
with
196 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/web/src/common/frames/NoManageClubForProfessor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
|
||
import styled from "styled-components"; | ||
|
||
import ErrorPageTemplate from "@sparcs-clubs/web/common/frames/ErrorPageTemplate"; | ||
|
||
import type { NextPage } from "next"; | ||
|
||
const ErrorMessage = styled.div` | ||
color: ${({ theme }) => theme.colors.BLACK}; | ||
text-align: center; | ||
font-family: ${({ theme }) => theme.fonts.FAMILY.PRETENDARD}; | ||
font-size: 32px; | ||
font-weight: ${({ theme }) => theme.fonts.WEIGHT.MEDIUM}; | ||
line-height: 48px; | ||
word-break: keep-all; | ||
@media (max-width: ${({ theme }) => theme.responsive.BREAKPOINT.sm}) { | ||
font-size: 28px; | ||
} | ||
@media (max-width: ${({ theme }) => theme.responsive.BREAKPOINT.xs}) { | ||
font-size: 20px; | ||
line-height: 32px; | ||
} | ||
`; | ||
|
||
const NoManageClubForProfessor: NextPage = () => { | ||
const router = useRouter(); | ||
|
||
const Message = ( | ||
<ErrorMessage> | ||
지도교수는 동아리 대표자가 될 수 없습니다. | ||
<br /> | ||
지도 동아리 확인은 마이페이지에서 가능합니다. | ||
</ErrorMessage> | ||
); | ||
|
||
const goToMain = () => { | ||
router.push("/"); | ||
}; | ||
|
||
const goToMy = () => { | ||
router.push("/my"); | ||
}; | ||
|
||
return ( | ||
<ErrorPageTemplate | ||
message={Message} | ||
buttons={[ | ||
{ text: "메인 바로가기", onClick: goToMain }, | ||
{ text: "마이페이지 바로가기", onClick: goToMy }, | ||
]} | ||
/> | ||
); | ||
}; | ||
|
||
export default NoManageClubForProfessor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../src/features/manage-club/activity-report/services/useDeleteActivityReportProvisional.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import apiAct004, { | ||
ApiAct004RequestParam, | ||
} from "@sparcs-clubs/interface/api/activity/endpoint/apiAct004"; | ||
import { useMutation } from "@tanstack/react-query"; | ||
import { z } from "zod"; | ||
|
||
import { | ||
axiosClientWithAuth, | ||
UnexpectedAPIResponseError, | ||
} from "@sparcs-clubs/web/lib/axios"; | ||
|
||
type ISuccessResponseType = z.infer<(typeof apiAct004.responseBodyMap)[200]>; | ||
|
||
// TODO: (@dora) need new endpoint instead of ACT004 | ||
|
||
export const useDeleteActivityReportProvisional = () => | ||
useMutation< | ||
ISuccessResponseType, | ||
Error, | ||
{ requestParam: ApiAct004RequestParam } | ||
>({ | ||
mutationFn: async ({ requestParam }): Promise<ISuccessResponseType> => { | ||
const { data, status } = await axiosClientWithAuth.delete( | ||
`${apiAct004.url(requestParam.activityId)}/provisional`, | ||
{}, | ||
); | ||
|
||
switch (status) { | ||
case 200: | ||
return apiAct004.responseBodyMap[200].parse(data); | ||
default: | ||
throw new UnexpectedAPIResponseError(); | ||
} | ||
}, | ||
}); |
Oops, something went wrong.