Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

디스커션 및 솔루션 제출시 에러 수정 (issue #728) #729

Merged
merged 13 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/components/DiscussionSubmit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
discussionTitle,
isDiscussionTitleError,
isValidDiscussionTitle,
isValidDescription,
// isValidDescription,
handleDiscussionTitle,
handleMarkDownDescription,
isDescriptionError,
Expand Down Expand Up @@ -76,7 +76,7 @@
});
if (inputHashTags) setSelectedHashTags(inputHashTags);
}
}, [isEditMode, inputTitle, inputContent, inputMission, inputHashTags, member.id, userInfo?.id]);

Check warning on line 79 in frontend/src/components/DiscussionSubmit/index.tsx

View workflow job for this annotation

GitHub Actions / FE_CI

React Hook useEffect has missing dependencies: 'handleDescription' and 'handleDiscussionTitle'. Either include them or remove the dependency array

const handleFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
Expand Down Expand Up @@ -123,7 +123,7 @@
/>
<DiscussionDescription
value={description}
danger={isDescriptionError || !isValidDescription}
danger={isDescriptionError}
dangerMessage={ERROR_MESSAGE.no_content}
onChange={handleMarkDownDescription}
/>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/hooks/useDiscussionTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const MAX_DISCUSSION_TITLE_LENGTH = 50;
const useDiscussionTitle = () => {
const [discussionTitle, setDiscussionTitle] = useState('');
const [isDiscussionTitleError, setIsDiscussionTitleError] = useState(false);
const isValidDiscussionTitle =
discussionTitle.length && discussionTitle.length < MAX_DISCUSSION_TITLE_LENGTH;
const isValidDiscussionTitle = discussionTitle.length < MAX_DISCUSSION_TITLE_LENGTH;

const handleDiscussionTitle = (e: ChangeEvent<HTMLInputElement>) => {
const value = e.target.value;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/hooks/useSolutionTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ const MAX_SOLUTION_TITLE_LENGTH = 50;
const useSolutionTitle = () => {
const [solutionTitle, setSolutionTitle] = useState('');
const [isSolutionTitleError, setIsSolutionTitleError] = useState(false);
const isValidSolutionTitle =
solutionTitle.length && solutionTitle.length < MAX_SOLUTION_TITLE_LENGTH;
const isValidSolutionTitle = solutionTitle.length < MAX_SOLUTION_TITLE_LENGTH;

const handleSolutionTitle = (e: ChangeEvent<HTMLInputElement>) => {
const value = e.target.value;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/MissionSubmitPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default function MissionSubmitPage() {
isDescriptionError,
isSolutionTitleError,
isSubmitSolutionError,
isValidUrl,
isValidDescription,
// isValidUrl,
// isValidDescription,
isValidSolutionTitle,
// isMatchedMissionName,
} = useSubmitSolution({ missionId, missionName });
Expand Down Expand Up @@ -97,10 +97,10 @@ export default function MissionSubmitPage() {
value={url}
onChange={handleUrl}
missionId={missionId}
danger={isUrlError || isSubmitSolutionError || !isValidUrl}
danger={isUrlError || isSubmitSolutionError}
/>
<OneWord
danger={isDescriptionError || !isValidDescription}
danger={isDescriptionError}
dangerMessage={ERROR_MESSAGE.no_content}
value={description ?? ''}
onChange={handleMarkDownDescription}
Expand Down
Loading