Skip to content

[basic-박영서] sprint 3: 제출#29

Open
YoungSeo1104 wants to merge 13 commits intocodeit-sprint-fullstack:basic-박영서from
YoungSeo1104:basic-박영서

Hidden character warning

The head ref may contain hidden characters: "basic-\ubc15\uc601\uc11c"
Open

[basic-박영서] sprint 3: 제출#29
YoungSeo1104 wants to merge 13 commits intocodeit-sprint-fullstack:basic-박영서from
YoungSeo1104:basic-박영서

Conversation

@YoungSeo1104
Copy link
Collaborator

@YoungSeo1104 YoungSeo1104 commented Dec 9, 2025

작업 반영 링크 - https://ys-sprint-pandamarket.netlify.app/

  1. id, style명은 kebab-case로 통일
  2. html lang="en" -> "ko" 변경
  3. ArticleService은 axios, .then(), .catch() 사용, ProductService은 fetch 사용, try/catch문을 활용했습니다.
  4. 로그인, 회원가입 페이지에 쓰이는 alert창은 sweetalert2을 활용했습니다.

멘토님에게 남길 메시지

  1. login.js 코드가 실무에서 협업하기 좋은 코드인지 피드백 받고 싶습니다.
  2. 함수의 매개변수(parameter)에 type을 적는 연습을 하고 있는데, 맞게 썼는지도 시간 되시면 확인 부탁드립니다!

@YoungSeo1104 YoungSeo1104 self-assigned this Dec 9, 2025
@YoungSeo1104 YoungSeo1104 requested review from iamjaeholee and wseungjin and removed request for iamjaeholee December 9, 2025 14:16
@YoungSeo1104 YoungSeo1104 changed the title [basic-박영서] sprint 2: 피드백 반영 [basic-박영서] sprint 3: 제출 Dec 23, 2025
@YoungSeo1104 YoungSeo1104 added 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요! labels Dec 23, 2025
Copy link
Collaborator

@wseungjin wseungjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번주도 너무 수고 하셨습니다~

//type: (x: string, y: string, z: string) => void;
export const createArticle = ({ title, content, image }) => {
return instance
.post(`/articles`, { title, content, image })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation처리가 필요하다.

};

//type: (x: number, y: string[]) => void;
export const patchArticle = (id, data) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

무슨 데이터가 들어왔는지 알수 없습니다. validation이 필요해보입니다.

};

//type: (x: number) => void;
export const deleteArticle = (id) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete flag 에 대해서 알고 계신가요? soft delete에 대해서 공부해보시면 좋겠습니다.

{
   title: "안녕"
   delete : false 
}

export const getArticleList = (params) => {
return instance
.get(`/articles`, { params })
.then((res) => res.data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상태 코드에 대해서 공부를 해보면 좋을거 같아요.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


return await res.json();
} catch (error) {
console.log('getProductList Error:', error.message);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로깅을 나중에 제대로 해보면 좋을거 같아요.
파일로 남긴다거나, 네트워크로 요청을 한다거나, db에 남긴다거나 하면 좋을거 같아요.

deleteProduct,
} from './ProductService.js';

const articleAPI = async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실제 테스트코드 format으로 해보면 좋을거 같아요.
jest, mocha를 사용해보죠


let loginCheck = false;

export const USER_DATA = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다른 파일로 관리 하면 좋을거 같아요

];

// type: (x:string, y: HTMLInputElement) => void;
export const EyesOnOffHandler = (id, input) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수로 보이는데 eyesOnOffHandler로 네이밍 규칙을 잘 지켜주시면 좋을거 같아요~

pwInput.addEventListener('input', (e) => inputHandler('password'));

if (loginBtn) {
//조건1 - 만약 입력한 이메일이 데이터베이스(USER_DATA)에 없거나, 이메일은 일치하지만 비밀번호가 틀린 경우, '비밀번호가 일치하지 않습니다.'라는 메시지를 alert로 표시합니다
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 부분도 함수로 빼보면 어떨까요?

});
}

if (pwInputCheck) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파일이 너무 커진거 같아서 함수로 좀 분리해보면 좋을거 같습니다~

}
};

//type: (x: number) => void;
Copy link
Collaborator

@wseungjin wseungjin Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//type: (id: number) => void;

면 어떨까요?

실제 현업에서는

/**
 * 상품을 삭제한다
 *
 * @param {number | string} id - 삭제할 상품 ID
 * @returns {Promise<any>} 삭제 결과
 * @throws {Error} 네트워크 오류 또는 서버 오류
 */
export const deleteProduct = async (id) => {
  try {
    const res = await fetch(`${PRODUCT_URL}/${id}`, {
      method: 'DELETE',
    });

    if (!res.ok) {
      throw new Error(res.statusText);
    }

    return await res.json();
  } catch (error) {
    console.error('deleteProduct Error:', error);
    throw error;
  }
};

이렇게 사용합니다

@wseungjin
Copy link
Collaborator

wseungjin commented Dec 24, 2025

login.js 코드가 실무에서 협업하기 좋은 코드인지 피드백 받고 싶습니다.

=> 너무 역할이 많은거 같아서 좀 쪼개주시면 좋겠습니다.

함수의 매개변수(parameter)에 type을 적는 연습을 하고 있는데, 맞게 썼는지도 시간 되시면 확인 부탁드립니다!

//type: (id: number) => void;

면 어떨까요?

실제 현업에서는

/**
 * 상품을 삭제한다
 *
 * @param {number | string} id - 삭제할 상품 ID
 * @returns {Promise<any>} 삭제 결과
 * @throws {Error} 네트워크 오류 또는 서버 오류
 */
export const deleteProduct = async (id) => {
  try {
    const res = await fetch(`${PRODUCT_URL}/${id}`, {
      method: 'DELETE',
    });

    if (!res.ok) {
      throw new Error(res.statusText);
    }

    return await res.json();
  } catch (error) {
    console.error('deleteProduct Error:', error);
    throw error;
  }
};

이렇게 사용합니다

@wseungjin
Copy link
Collaborator

node_modules는 깃헙에 올리지 않습니다 gitignore를 공부하고 적용해주세요~

@YoungSeo1104 YoungSeo1104 reopened this Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants