Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
eejx0 committed Nov 14, 2024
2 parents 33bc249 + 83d15a8 commit d499b4c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Apis/Notices/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const useNoticeListData = () => {

useEffect(() => {
fetchNoticeList();

}, [fetchNoticeList]);

return { notices };
Expand Down
2 changes: 1 addition & 1 deletion src/Apis/Notices/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AttachmentType } from "./response";
export interface NoticeWrite {
title: string;
content: string;
attachments: AttachmentRequest[];
attachments?: AttachmentRequest[];
}

export interface NoticeEdit {
Expand Down
2 changes: 1 addition & 1 deletion src/Apis/Notices/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface NoticeDetailResponse {
title: string;
content: string;
created_at: string;
attachments: AttachmentResponse[];
attachments?: AttachmentResponse[];
}

export type AttachmentType =
Expand Down
13 changes: 11 additions & 2 deletions src/Apis/Recruitments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,22 @@ export const useGetRecruitmentForm = (
{
queryKey: ['getRecruitmentCount', searchRecruitmentFormQueryString],
queryFn: async () => {
const { winter_intern } = searchRecruitmentFormQueryString;
const {
year,
company_name,
start,
end,
status,
winter_intern,
} = searchRecruitmentFormQueryString;
const winterIntern =
winter_intern !== null
? `&winter_intern=${winter_intern}`
: '';
const { data } = await instance.get<{ count: number }>(
`${router}/count?${winterIntern}`
`${router}/count?year=${year}${winterIntern}&company_name=${company_name}&start=${start}&end=${end}&status=${
status === '전체' || status === undefined ? '' : status
}`
);
return data;
},
Expand Down
10 changes: 8 additions & 2 deletions src/Pages/NoticePage/NoticeWritePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function NoticeWritePage() {
const navigate = useNavigate();

const { mutate: writeNotice } = useNoticeWriteData();

const { mutate: getPresignedUrl, data } = usePresignedUrl();

useEffect(() => {
Expand Down Expand Up @@ -91,6 +90,13 @@ export function NoticeWritePage() {
const handleNoticeSubmit = () => {
if (attachments.length > 0) {
getPresignedUrl(attachments);
} else {
writeNotice({
title,
content,
attachments: [{url: '', type: 'FILE'}],
});
navigate('/Notice')
}
};

Expand Down Expand Up @@ -136,7 +142,7 @@ export function NoticeWritePage() {
<_.FileWrap>
<_.Text>첨부파일</_.Text>
<_.AddFileWrapper>
{attachments.map(
{attachments?.map(
(file: File, index: number) => (
<_.AddFile key={index}>
{file.name}
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/PopUp/ApplicationPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function ApplicationPopup() {
student_name: '',
recruitment_id: id ? id : '',
year: date.getFullYear().toString(),
winter_intern: false,
winter_intern: true,
});

const {
Expand Down

0 comments on commit d499b4c

Please sign in to comment.