Skip to content

Commit

Permalink
Merge pull request #487 from woowacourse-teams/FE/dev
Browse files Browse the repository at this point in the history
[FE] 🔖 운영 서버 배포
  • Loading branch information
anttiey authored Aug 23, 2024
2 parents 9fb402a + 2777caa commit 66907d7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
12 changes: 6 additions & 6 deletions frontend/src/apis/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Todo {

export const getTodos = async (accessCode: string): Promise<Todo[]> => {
const response = await fetcher.get({
url: `${API_URL}/api/${accessCode}/todos`,
url: `${API_URL}/${accessCode}/todos`,
errorMessage: ERROR_MESSAGES.GET_TODOS,
});

Expand All @@ -27,7 +27,7 @@ interface AddTodosRequest {

export const addTodos = async ({ content, accessCode }: AddTodosRequest) => {
await fetcher.post({
url: `${API_URL}/api/${accessCode}/todos`,
url: `${API_URL}/${accessCode}/todos`,
body: JSON.stringify({ content }),
errorMessage: ERROR_MESSAGES.ADD_TODO,
});
Expand All @@ -40,7 +40,7 @@ interface UpdateContentsRequest {

export const updateContents = async ({ todoId, contents }: UpdateContentsRequest) => {
await fetcher.patch({
url: `${API_URL}/api/todos/${todoId}/contents`,
url: `${API_URL}/todos/${todoId}/contents`,
body: JSON.stringify({ contents }),
errorMessage: ERROR_MESSAGES.UPDATE_TODO,
});
Expand All @@ -53,7 +53,7 @@ interface UpdateOrderRequest {

export const updateOrder = async ({ todoId, order }: UpdateOrderRequest) => {
await fetcher.patch({
url: `${API_URL}/api/todos/${todoId}/order`,
url: `${API_URL}/todos/${todoId}/order`,
body: JSON.stringify({ order }),
errorMessage: ERROR_MESSAGES.UPDATE_TODO,
});
Expand All @@ -65,7 +65,7 @@ interface UpdateCheckedRequest {

export const updateChecked = async ({ todoId }: UpdateCheckedRequest) => {
await fetcher.patch({
url: `${API_URL}/api/todos/${todoId}/checked`,
url: `${API_URL}/todos/${todoId}/checked`,
errorMessage: ERROR_MESSAGES.UPDATE_TODO,
});
};
Expand All @@ -76,7 +76,7 @@ interface DeleteTodoRequest {

export const deleteTodo = async ({ todoId }: DeleteTodoRequest) => {
await fetcher.delete({
url: `${API_URL}/api/todos/${todoId}`,
url: `${API_URL}/todos/${todoId}`,
errorMessage: ERROR_MESSAGES.DELETE_TODO,
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ReferenceCard = ({ accessCode, isOpen, toggleIsOpen }: ReferenceCardProps)
const { addCategory } = useAddCategory();

const validateCategoryName = (category: string): { status: InputStatus; message: string } => {
if (category.length >= 8)
if (category.length > 8)
return {
status: 'ERROR',
message: '8자 이하로 입력해주세요',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const TimerDurationInput = ({ timerDuration, onTimerDuration }: TimerDurationInp
value={timerDuration}
placeholder="타이머 시간 (분)"
status={!validateTimerDuration(timerDuration) ? 'ERROR' : 'DEFAULT'}
message={!validateTimerDuration(timerDuration) ? '0 이상의 숫자를 입력해 주세요.' : ''}
message={!validateTimerDuration(timerDuration) ? '1 이상 99 이하의 숫자를 입력해 주세요.' : ''}
disabled={!isCustom}
onChange={handleCustomTime}
/>
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/pages/PairRoomOnboarding/PairRoomOnboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ const PairRoomOnboarding = () => {
{moveIndex >= 2 && (
<TimerDurationInput timerDuration={timerDuration} onTimerDuration={handleTimerDuration} />
)}
<S.ButtonWrapper>
<Button disabled={validationList.some((valid) => !valid)} onClick={handleSuccess}>
{BUTTON_TEXT.COMPLETE}
</Button>
</S.ButtonWrapper>
{moveIndex >= 3 && (
<S.ButtonWrapper>
<Button disabled={validationList.some((valid) => !valid)} onClick={handleSuccess}>
{BUTTON_TEXT.COMPLETE}
</Button>
</S.ButtonWrapper>
)}
</S.InputContainer>
)}
</S.Container>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/validations/validateTimerDuration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const validateTimerDuration = (timerDuration: string) => {
if (Number.isNaN(timerDuration)) return false;
if (Number(timerDuration) <= 0) return false;
if (Number.isNaN(Number(timerDuration))) return false;
if (Number(timerDuration) <= 0 || Number(timerDuration) >= 100) return false;

return true;
};

0 comments on commit 66907d7

Please sign in to comment.