-
Notifications
You must be signed in to change notification settings - Fork 46
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
[오동혁] Week15 #477
The head ref may contain hidden characters: "part3-\uC624\uB3D9\uD601"
[오동혁] Week15 #477
Conversation
…ithub-actions [Fix] delete merged branch github action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 :)
실제 현업에서 쿠키, 세션, 토큰등을 사용해서 어떤 방법으로 인증 처리하는지 궁금합니다.
제가 했던 프로젝트는 쿠키를 요청때마다 헤더로 middleware 를 통해 전송하는 식으로 구현했어요!
쿠키에 accessToken 을 넣는 식으로 했고, accessToken 내부에 사용자 정보 등이 들어있어서 인증했었습니다!
interface ItemsProps { | ||
folderData: FetchData<FolderData[]>; | ||
linkData: FetchData<LinkData[]>; | ||
folderData?: FetchData<FoldersData>; | ||
linkData?: FetchData<LinksData>; | ||
shareLinkData?: FetchData<LinkData[]>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전부 Optional 한 속성이면 Partial<> 써보셔도 좋을 거 같아요~ (의미상으로 맞다면)
https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype
return ( | ||
<> | ||
{!loading && | ||
error === null && | ||
(data?.folder.length === 0 ? ( | ||
<EmptyDiv> | ||
<EmptySpan>저장된 링크가 없습니다.</EmptySpan> | ||
</EmptyDiv> | ||
) : ( | ||
data?.folder.map((item) => ( | ||
<Item | ||
key={item.id} | ||
createdAt={item.created_at} | ||
url={item.url} | ||
title={item.title} | ||
description={item.description} | ||
imageSource={item.image_source} | ||
folderData={folderData} | ||
editable={true} | ||
/> | ||
)) | ||
))} | ||
</> | ||
); | ||
} | ||
|
||
if (shareLinkData) { | ||
const { data, loading, error } = shareLinkData; | ||
|
||
return ( | ||
<> | ||
{!loading && | ||
error === null && | ||
(data?.length === 0 ? ( | ||
<EmptyDiv> | ||
<EmptySpan>저장된 링크가 없습니다.</EmptySpan> | ||
</EmptyDiv> | ||
) : ( | ||
data?.map((item) => ( | ||
<Item | ||
key={item.id} | ||
createdAt={item.created_at} | ||
url={item.url} | ||
title={item.title} | ||
description={item.description} | ||
imageSource={item.image_source} | ||
editable={false} | ||
/> | ||
)) | ||
))} | ||
</> | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
거의 두 개가 동일해서 합치면 좋을 거 같아요!
const givenData = linkData || shareLinkData
한 뒤에 합치면 될 거 같아요~
loading: folderData.loading, | ||
error: folderData.error, | ||
}} | ||
folderId={folderId ? parseInt(folderId.toString()) : 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folderId={folderId ? parseInt(folderId.toString()) : 0} | |
folderId={folderId ? parseInt(folderId.toString() ,10) : 0} |
parseInt 쓰실 때 왠만하면 인수도 같이 써주셔요!
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게