Skip to content

Commit

Permalink
Merge pull request #1513 from 42organization/agenda
Browse files Browse the repository at this point in the history
[test-deploy] 아젠다 기능 구현 테스트(재)(재): 빌드 오류 해결
  • Loading branch information
cweedlee authored Aug 31, 2024
2 parents 3aa78ef + 3d4fbcb commit 4ffc625
Show file tree
Hide file tree
Showing 74 changed files with 34 additions and 308 deletions.
2 changes: 1 addition & 1 deletion components/agenda/Form/AgendaResultForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const AgendaResultForm = ({

const removeAward = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
const target = e.target.closest('li');
const target = (e.target as HTMLElement).closest('li');
if (target === null) return;
const idx = parseInt(target.getAttribute('id') || '0') - 1;
if (idx === -1) return;
Expand Down
2 changes: 1 addition & 1 deletion components/agenda/Form/AnnouncementForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const SubmitAnnouncementForm = async (
url,
jsonData,
params,
(res) => {
() => {
handleProceed && handleProceed();
},
(error: string) => {
Expand Down
2 changes: 1 addition & 1 deletion components/agenda/Home/MyTeamInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const MyTeamInfo = ({
return <div>참가중인 일정이 없습니다.</div>;
}
// myTeamInfo.isOfficial = true; //css test
const startDate = new Date(myTeamInfo.agendaStartTime);
const startDate = new Date(myTeamInfo.agendaStartTime as string);
//아래 주석달린 부분은 api 변경시 추가 예정입니다.
return (
<div className={styles.Container} key={key}>
Expand Down
1 change: 0 additions & 1 deletion components/agenda/Input/AgendaSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import MenuItem from '@mui/material/MenuItem';
import Select from '@mui/material/Select';
import { AgendaListProps } from 'types/agenda/agendaDetail/agendaTypes';

interface AgendaSelectProps {
selectedKey: string;
Expand Down
9 changes: 4 additions & 5 deletions hooks/agenda/usePageNation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { instanceInAgenda } from 'utils/axios';

const usePageNation = <T>({
url,
size,
size = 20,
useIdx,
params,
}: {
Expand All @@ -21,11 +21,10 @@ const usePageNation = <T>({
params = params ? params : {};
params.page = currentPage.current;
params.size = size;
const getData = async (page: number) => {
const getData = async (page: number, size: number) => {
const res = await instanceInAgenda.get(url, { params });
const content = res.data.content ? res.data.content : [];
const totalSize = res.data.totalSize ? res.data.totalSize : 0;

if (useIdx) {
res.data.content = res.data.content.map((c: T, idx: number) => {
const temp = c as T & { idx: number };
Expand All @@ -40,15 +39,15 @@ const usePageNation = <T>({

const pageChangeHandler = async (pageNumber: number) => {
if (pageNumber < 1 || pageNumber > totalPages.current) return;
await getData(pageNumber).then((res) => {
await getData(pageNumber, size).then((res) => {
currentPage.current = pageNumber;
setContent(res.content);
});
};

useEffect(() => {
const fetchData = async () => {
const data = await getData(currentPage.current);
const data = await getData(currentPage.current, size);
totalPages.current = Math.ceil(data.totalSize / size);
setContent(data.content);
};
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-storybook": "^0.6.12",
"husky": "^8.0.2",
"husky": "^8.0.3",
"lint-staged": "^13.0.3",
"prettier": "^2.6.2",
"react-error-boundary": "^4.0.4",
Expand Down
7 changes: 5 additions & 2 deletions pages/agenda/[agendaKey]/host/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ const SubmitAgendaResult = () => {
data: {},
status: 400,
};
const teamlist = data?.content.map((team) => team.teamName) || [];
const teamlist: string[] = [];
data?.content?.forEach((team) => {
team.teamName && teamlist.push(team.teamName);
});

const SubmitAgendaResult = (awardList: AwardListProps[]) => {
const Data = parseData(awardList);
Expand Down Expand Up @@ -129,7 +132,7 @@ const SubmitAgendaResult = () => {
<AgendaResultForm
awardList={awardList}
setAwardList={setAwardList}
teamlist={teamlist}
teamlist={teamlist || []}
SubmitAgendaResult={(e) => {
e.preventDefault();
SubmitAgendaResult(awardList);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,8 @@ export const dummyLiveTournamentGames = {
},
],
};

const dummy = () => {
return null;
};
export default dummy;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type TournamentData = {
users: number[];
}[];

const DummyData: TournamentData = [
export const DummyData: TournamentData = [
{
tournamentId: 56,
users: [1],
Expand All @@ -14,4 +14,7 @@ const DummyData: TournamentData = [
},
];

export default DummyData;
const dummy = () => {
return null;
};
export default dummy;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// pages/api/tournaments/[tournamentId]/users.ts
import { NextApiRequest, NextApiResponse } from 'next';
import DummyData from './dummyData';
import { DummyData } from './dummyData';
function isString(value: any): value is string {
return typeof value === 'string';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const junhjeon = {

const users = [jincpark, jaehyuki, junhjeon];

const dummyTournaments: TournamentInfo[] = [];
export const dummyTournaments: TournamentInfo[] = [];

for (let i = 28; i >= 1; i--) {
let status;
Expand Down Expand Up @@ -63,4 +63,7 @@ for (let i = 28; i >= 1; i--) {
dummyTournaments.push(masterTournament, rookieTournament);
}

export default dummyTournaments;
const dummy = () => {
return null;
};
export default dummy;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextApiRequest, NextApiResponse } from 'next';
import dummyTournaments from './dummyTournamentData';
import { dummyTournaments } from './dummyTournamentData';

export default function handler(req: NextApiRequest, res: NextApiResponse) {
const { page, type, status, size } = req.query as {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions stories/agenda/Form/CreateAgenda.stories.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions stories/agenda/TeamDetail/TeamDetail.stories.tsx

This file was deleted.

Loading

0 comments on commit 4ffc625

Please sign in to comment.