Skip to content

Commit

Permalink
Hotfix/#74/minha (#85)
Browse files Browse the repository at this point in the history
* fix: 콘솔 에러 수정 및 관리자 관련 기능 캐싱 삭제

* fix: 공고 수정 안내 문구 변경

* fix: 검색 시 지역명 전국은 null로 보내도록 수정

* fix: 페이지 이동 후에도 검색 결과가 남는 버그 수정
  • Loading branch information
AAminha authored Nov 23, 2023
1 parent d75bc34 commit 36ce584
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
6 changes: 0 additions & 6 deletions src/apis/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ export const useGetProgressPrograms = ({
['getProgressPrograms', filter, page],
() => ManagerAPI.getProgressPrograms({ filter, page: page - 1 }),
{
cacheTime: 500000,
staleTime: 500005,
onSuccess: () => {},
onError: () => {},
},
Expand All @@ -130,8 +128,6 @@ export const useGetFinishPrograms = ({
['getFinishPrograms', filter, page],
() => ManagerAPI.getFinishPrograms({ filter, page: page - 1 }),
{
cacheTime: 500000,
staleTime: 500005,
onSuccess: () => {},
onError: () => {},
},
Expand All @@ -143,8 +139,6 @@ export const useGetExistingProgram = (programId: number) => {
['getExistingProgram', programId],
() => ManagerAPI.getExistingProgram(programId),
{
cacheTime: 500000,
staleTime: 500005,
onSuccess: () => {},
onError: () => {},
},
Expand Down
4 changes: 2 additions & 2 deletions src/apis/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useQuery } from 'react-query';
import Axios from '.';

interface FilterType {
[key: string]: string | number | undefined;
[key: string]: string | number | undefined | null;
programName?: string;
orderCriteria?: string;
location?: string;
location?: string | null;
programType?: string;
detailType?: string;
recruitStartDate?: string;
Expand Down
1 change: 1 addition & 0 deletions src/constants/Register/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const ALERT_MESSAGE = {
register: '공고를 등록하시겠습니까?',
draft: '임시 저장하시겠습니까?',
getDraft: '기존에 작성하던 공고를 불러오시겠습니까?',
edit: '공고를 수정하시겠습니까?',
};

const EXAMPLE_HEADER =
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ModifyProgram/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const EditProgram = () => {
.replace(/ /g, '');

if (result) {
if (window.confirm(ALERT_MESSAGE.register)) {
if (window.confirm(ALERT_MESSAGE.edit)) {
programId && formData.append('id', String(programId));
photoName !== null && formData.append('photo', photoName);
formData.append('photoCheck', photoName === null ? '0' : '1');
Expand Down
2 changes: 1 addition & 1 deletion src/pages/RegisterProgram/DetailInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DetailInfo = ({ content, setContent }: DetailInfoFieldProps) => {
<H3 $fontColor="var(--color_gray900)">상세 입력 내용</H3>
<textarea
placeholder={DETAIL_INFO_PLACEHOLDER}
value={content.body}
value={content.body !== null ? content.body : ''}
onChange={e => {
setContent({ ...content, body: e.target.value });
}}
Expand Down
20 changes: 11 additions & 9 deletions src/pages/RegisterProgram/Input/InputDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ const InputDropdown = ({
<Container>
<span>{dropdownTitle}</span>
<hr />
{dropdownItemList.map(item => (
<span
key={item}
className={`dropdown-item ${dropdownTitle === item && 'active'}`}
onClick={() => onDropdownClick(field, item)}
>
{item}
</span>
))}
{dropdownItemList
.filter(value => value !== '전국')
.map(item => (
<span
key={item}
className={`dropdown-item ${dropdownTitle === item && 'active'}`}
onClick={() => onDropdownClick(field, item)}
>
{item}
</span>
))}
</Container>
);
};
Expand Down
8 changes: 6 additions & 2 deletions src/pages/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
import { useGetSearchProgram } from '@/apis/program';

interface Test {
[key: string]: string | number | undefined;
[key: string]: string | number | undefined | null;
programName?: string;
orderCriteria?: string;
location?: string;
location?: string | null;
programType?: string;
detailType?: string;
recruitStartDate?: string;
Expand Down Expand Up @@ -42,6 +42,9 @@ const Search = () => {
if (keyword) {
setSearchInput(keyword);
newApiData['programName'] = keyword;
} else {
setSearchInput('');
newApiData['programName'] = '';
}

for (const key in newFilterInput) {
Expand All @@ -54,6 +57,7 @@ const Search = () => {
}

if (!newApiData['orderCriteria']) newApiData['orderCriteria'] = '최신순';
if (newApiData['location'] === '전국') newApiData['location'] = null;

setFilterInput({ ...newFilterInput });

Expand Down

0 comments on commit 36ce584

Please sign in to comment.