Skip to content

Commit

Permalink
feat: 스터디 생성하기 페이지 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 committed Aug 13, 2024
1 parent 333e298 commit f122b3d
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 7 deletions.
32 changes: 32 additions & 0 deletions apps/admin/app/api/auth/MemberType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { Status } from "types/status";
import type { User } from "types/user";

export interface MemberInfoResponse {
member: User;
currentRecruitmentRound: CurrentRecruitmentType;
currentMembership: CurrentMembershipType;
}

export interface CurrentRecruitmentType {
recruitmentId: number;
name: string;
period: {
startDate: string;
endDate: string;
open: boolean;
};
fee: number;
roundType: "FIRST" | "SECOND";
roundTypeValue: string;
}

export interface CurrentMembershipType {
membershipId: number;
memberId: number;
recruitmentId: number;
regularRequirement: {
paymentStatus: Status;
allSatisfied: boolean;
paymentSatisfied: boolean;
};
}
13 changes: 13 additions & 0 deletions apps/admin/app/api/auth/route.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const dynamic = "force-static";

export async function GET() {
const res = await fetch(
"https://dev-api.gdschongik.com/onboarding/members/me/dashboard",
{
credentials: "same-origin",
}
);
const data = await res.json();

return Response.json({ data });
}
1 change: 0 additions & 1 deletion apps/admin/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "./global.css";
import "wowds-ui/styles.css";

import Navbar from "components/Navbar";
import type { Metadata } from "next";

import { JotaiProvider } from "../components/JotaiProvider";
Expand Down
5 changes: 5 additions & 0 deletions apps/admin/app/studies/createStudy/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const CreateStudyPage = () => {
return <div>스터디 생성</div>;
};

export default CreateStudyPage;
5 changes: 0 additions & 5 deletions apps/admin/components/auth/isMentor.tsx

This file was deleted.

8 changes: 7 additions & 1 deletion apps/admin/components/createStudy/CreateStudyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
"use client";
import { css } from "@styled-system/css";
import { Flex } from "@styled-system/jsx";
import { useRouter } from "next/navigation";

const CreateStudyButton = () => {
const router = useRouter();
return (
<button className={createStudyButtonStyle}>
<button
className={createStudyButtonStyle}
onClick={() => router.push("studies/createStudy")}
>
<Flex gap="xs">
<p className={css({ textStyle: "label1", color: "sub" })}>
새로운 스터디 개설하기
Expand Down
3 changes: 3 additions & 0 deletions apps/admin/types/role.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type ManageRole = "ADMIN" | "NONE";
export type StudyRole = "MENTOR" | "STUDENT";
export type UserRoleType = "GUEST" | "ASSOCIATE" | "REGULAR";
2 changes: 2 additions & 0 deletions apps/admin/types/status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export type Status = "UNSATISFIED" | "SATISFIED";
export type UnivEmailStatus = "IN_PROGRESS" | "UNSATISFIED" | "SATISFIED";
33 changes: 33 additions & 0 deletions apps/admin/types/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { ManageRole, StudyRole, UserRoleType } from "./role";
import type { Status, UnivEmailStatus } from "./status";

export type User = {
memberId: string; // C000000 (학번)
role: UserRoleType;
basicInfo: UserBasicInfo;
manageRole: ManageRole;
studyRole: StudyRole;
associateRequirement: {
univStatus: UnivEmailStatus;
discordStatus: Status;
bevyStatus: Status;
infoStatus: Status;
};
};

export type AssociateRequirement = {
univStatus: UnivEmailStatus;
discordStatus: Status;
bevyStatus: Status;
infoStatus: Status;
};

export type UserBasicInfo = {
name: string;
studentId: string;
email: string;
department: string;
phone: string;
discordUsername: string;
nickname: string;
};
14 changes: 14 additions & 0 deletions apps/admin/utils/isMentor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { fetcher } from "@wow-class/utils";
import type { User } from "types/user";

const isMentor = async () => {
const response = await fetcher
.get<User>("/onboarding/members/me/dashboard", {
credentials: "include",
})
.then((response) => {
console.log(response.data?.studyRole);
});
};

export default isMentor;

0 comments on commit f122b3d

Please sign in to comment.