Skip to content

Conversation

@najitwo
Copy link
Owner

@najitwo najitwo commented Nov 17, 2024

๐Ÿ“Œ Related Issue

close #7

๐Ÿ“ Description

  • ๋งˆ์ดํŽ˜์ด์ง€ ์œ ์ € API ์—ฐ๋™
  • ๋กœ๊ทธ์ธํ•œ ์œ ์ € ์ •๋ณด ์กฐํšŒ ๋ฐ ์ˆ˜์ •

@najitwo najitwo added โœจFeature Request for a new feature or functionality ๐Ÿ“ฌAPI Tasks related to integrating or connecting to external APIs labels Nov 17, 2024
@najitwo najitwo self-assigned this Nov 17, 2024
@najitwo najitwo linked an issue Nov 17, 2024 that may be closed by this pull request
3 tasks
"rules": {
"prettier/prettier": ["error"],
"no-unused-vars": "warn",
"@typescript-eslint/no-unused-vars": "warn"
Copy link
Owner Author

Choose a reason for hiding this comment

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

์ด๊ฑฐ ๋‘˜์ด ๊ฐ™์ด ์žˆ์œผ๋ฉด ์ถฉ๋Œ๋‚˜์„œ ๊ฒฝ๊ณ  ๋ฐ‘์ค„์ด ์ด์ƒํ•˜๊ฒŒ ๋œจ๋”๋ผ๊ณ ์š”
์ €ํฌ ์–ด์ฐจํ”ผ typescript๋งŒ ์‚ฌ์šฉํ•˜๋‹ˆ๊นŒ ์œ„์—๊ฑด ์ง€์› ์Šต๋‹ˆ๋‹ค.

@najitwo najitwo requested review from a user, devmanta and naseungyeop November 17, 2024 01:24
Copy link
Collaborator

@devmanta devmanta left a comment

Choose a reason for hiding this comment

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

๐Ÿ‘ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค
๋ณด๋‹ˆ๊นŒ ๊ฐ์ž apiํ˜ธ์ถœํ•˜๋Š” ๋ถ€๋ถ„ ๊ตฌํ˜„ํ•ด๋ณด๋Š”๊ฑฐ๋ผ์„œ ์ค‘๋ณต๋˜๋Š”๋ฐ
์„œ๋กœ ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ–ˆ๋Š”์ง€ ๋ณด๊ณ  ๋ณด์™„ํ•ด์„œ ํ†ตํ•ฉ์ž‘์—… ์ง„ํ–‰ํ•ด๋„ ์ข‹์„๊ฒƒ๊ฐ™์Šต๋‹ˆ๋‹ค~

+์•„๊ทธ๋ฆฌ๊ณ  ํด๋”๊ตฌ์กฐ๋กœ router์„ค์ •์ด ๋˜๋‹ค๋ณด๋‹ˆ ๋ผ์šฐํŒ… ์•ˆํ•˜๋ ค๊ณ ํ•˜๋Š” ์• ๋Š” ์•ž์— private๋А๋‚Œ์œผ๋กœ๋‹ค๊ฐ€ _ ๋„ฃ๋Š”๋‹ค๊ณ  ํ•˜๋”๋ผ๊ตฌ์š”..?
mypageํ•˜์œ„์— ๋ณด๋ฉด components ๋””๋ ‰ํ† ๋ฆฌ ๋“ฑ๋“ฑ ์žˆ๋Š”๋ฐ ๋ผ์šฐํŒ… ํ•„์š”ํ•˜์ง€ ์•Š๋Š”์• ๋“ค์€ _ ๋ถ™์—ฌ์„œ ์‚ฌ์šฉํ•˜๋Š”๊ฑด ์–ด๋•Œ์š”?

}
};

useEffect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

use client ์ตœ์ƒ์œ„์— ์„ ์–ธ ์•ˆํ•ด์ค˜๋„ ๋™์ž‘ํ•˜๋‚˜๋ณด๊ตฐ์š”?

Copy link
Owner Author

Choose a reason for hiding this comment

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

๋ถ€๋ชจ์ปดํฌ๋„ŒํŠธ๊ฐ€ 'use client' ๋กœ ๋˜์–ด์žˆ์œผ๋ฉด ํ•„์š” ์—†๊ธด ํ•œ๋ฐ...
๊ณต์šฉ์œผ๋กœ ๋นผ๋ ค๋ฉด ๊ณ ๋ คํ•ด๋ณผ ์‚ฌํ•ญ์ด๋„ค์š”..!


export default function FileInput({ name, setValue }: FileInputProps) {
const [preview, setPreview] = useState('');
export default function FileInput({ name, setValue, url, id }: FileInputProps) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

์š”๊ธฐ์„œ name์€ ํ•ญ์ƒ 'image' ๋ฌธ์ž์—ด ๊ณ ์ •๊ฐ’ ๋งž์„๊นŒ์š”?
๊ทธ๋Ÿผ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์•ˆ๋ฐ›์•„๋„ ๋˜๋Š”..๋А๋‚Œ์ผ๊นŒ์š”..?

Copy link
Owner Author

Choose a reason for hiding this comment

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

๋„ค image file input ์šฉ๋„๋กœ๋งŒ ์‚ฌ์šฉํ•  ๊ฑฐ ๊ฐ™์•„์„œ 'image' ๊ณ ์ •์ž…๋‹ˆ๋‹ค.
ํŒŒ๋ผ๋ฏธํ„ฐ๋Š” ์—†์–ด๋„ ๋˜๊ฒ ๋„ค์š” ๐Ÿ‘€

const { login, getMe } = useAuth();

const handleLoad = async () => {
await login();
Copy link
Collaborator

Choose a reason for hiding this comment

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

์ด๊ฑฐ๋Š” ๋กœ๊ทธ์ธ ์•ˆ๋˜์–ด์žˆ์œผ๋ฉด ๊ฐ•์ œ๋กœ๊ทธ์ธ ์‹œํ‚ค๋Š” ๊ฑด๊ฐ€์š”?
๋งŒ์•ฝ์— ๊ทธ๋Ÿฐ๊ฑฐ๋ผ๋ฉด
์ œ๊ฐ€ ์ž‘์—…ํ•˜๋‹ค๊ฐ€ ๋กœ๊ทธ์ธํ•ด์•ผ์ง€ ๋“ค์–ด์˜ฌ์ˆ˜์žˆ๋Š”๊ฒฝ๋กœ๋Š”
accessToken ์—†์œผ๋ฉด loginํŽ˜์ด์ง€๋กœ redirect์‹œํ‚ค๋Š” middleware์ถ”๊ฐ€ํ•ด๋†จ๋Š”๋ฐ
์š”๊ฑฐ ์‚ฌ์šฉํ•ด๋ด๋„ ์ข‹์„๊ฒƒ๊ฐ™์Šต๋‹ˆ๋‹น (๋‹ค์ŒPR์— ์˜ฌ๋ฆฌ๋ ค๊ณ  ๋Œ€๊ธฐ์ค‘..)

Copy link
Owner Author

Choose a reason for hiding this comment

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

login ๊ด€๋ จ ๋กœ์ง๋“ค์€ ์ œ๊ฐ€ ๊ทธ๋ƒฅ ํ…Œ์ŠคํŠธํ• ๋•Œ ํŽธํ•˜๊ฒŒํ•˜๋ ค๊ณ  ๋„ฃ์€๊ฒ๋‹ˆ๋‹ค..!
์ •์ƒ์ ์ธ ๋กœ์ง์ด๋ผ๋ฉด ๋กœ๊ทธ์ธ ํ›„ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•ด์•ผ๊ฒ ์ฃ ..!

Copy link
Collaborator

Choose a reason for hiding this comment

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

์ด๋ถ€๋ถ„์€ ์Šน์—ฝ๋‹˜ ๋‹ด๋‹นํ•˜๋Š” ๋ถ€๋ถ„์ธ๊ฒƒ ๊ฐ™์€๋ฐ ์Šน์—ฝ๋‹˜ ์–ด๋–ป๊ฒŒ ๊ตฌ์ƒํ•˜๊ณ  ๊ณ„์‹ ์ง€ ์ƒ์˜ํ•ด๋ณด๊ณ  ๊ณตํ†ต์ ์šฉํ•ด๋ณด์‹œ์ฃ ~!

}
};

const login = async () => {
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.

์—ฌ๊ธฐ์„œ ํ–‰ํ•ด์ง€๋Š” ๋‚ด์šฉ์„๋ณด๋ฉด profile์ด๋ž‘ ๋น„๋ฐ€๋ฒˆํ˜ธ ์—…๋ฐ์ดํŠธ ํ•˜๋Š” apiํ˜ธ์ถœ์„ ํ•˜๋Š”๊ฒƒ ๊ฐ™์€๋ฐ
ํŒŒ์ผ๋ช…์ด authHelper๋ผ์„œ ์•ฝ๊ฐ„ ์Œ... ์ข€ ๋‹ค๋ฅธ๋А๋‚Œ?์ด ๋“ค๊ธดํ•ฉ๋‹ˆ๋‹ค
auth๋ผ๊ณ  ํ•˜๋ฉด ์ธ์ฆ/์ธ๊ฐ€ ๊ด€๋ จ๋œ ๋ฌด์–ธ๊ฐ€ ์ผ๊ฒƒ๊ฐ™์€๋ฐ ๋ณด๋ฉด์€ ์‚ฌ์šฉ์ž์ •๋ณด ์—…๋ฐ์ดํŠธ ํ•˜๋Š” ๋‚ด์šฉ์ด๋“ค์–ด์žˆ์–ด๊ฐ€์ง€๊ตฌ..

Copy link
Owner Author

Choose a reason for hiding this comment

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

ํŒŒ์ผ๋ช…์—๋Œ€ํ•ด ํ•œ๋ฒˆ ๋” ์ƒ๊ฐํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.. ์–ด๋ ต๋„ค์š” ๐Ÿค”

Comment on lines +30 to +31
if (error instanceof Error) {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

์š”๋‚ด์šฉ์€ ์•„์ง ์•ˆ์ฑ„์›Œ์ง„๊ฑฐ์ฃ ?ใ…‹ใ…‹

setUser: (user: User | null) => void;
}

const useAuthStore = create<AuthState>((set) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

์˜ค.. zustand ์ด๋ ‡๊ฒŒ๋งŒ ์“ฐ๋ฉด ์ดต์ดต ๋‹ค๋˜๋Š”๊ฑด๊ฐ€์š”? ๐Ÿ‘
๊ทผ๋ฐ ๊ทธ๋Ÿผ ์–˜๋Š” context์ฒ˜๋Ÿผ ์ ์šฉ๋ฒ”์œ„๋ฅผ children์œผ๋กœ ๏ฟฝ๊ฐ์‹ธ์ง€ ์•Š๋Š”๋ฐ
์ ์šฉ๋ฒ”์œ„๋Š” ํ•ญ์ƒ ์ „์ฒด๋ฒ”์œ„(?)์— ์ ์šฉ๋˜๋Š”๊ฑด๊ฐ€์š”?

Copy link
Owner Author

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.

์š”๊ฒƒ๋„ ํ†ตํ•ฉ๋Œ€์ƒ..!

@najitwo najitwo merged commit 186c0bb into develop Nov 17, 2024
najitwo added a commit that referenced this pull request Nov 18, 2024
* โœจ feat: integrate user API for mypage

* โ™ป๏ธ refactor: improve form component for readability

* ๐Ÿ”ฅ comment: remove comment

* ๐Ÿ”ฅ remove: remove unnecessary code

* โ™ป๏ธ refactor: update FileInput types for flexibility
@najitwo najitwo deleted the 7-feat-integrate-user-api-for-mypage branch November 19, 2024 03:02
najitwo added a commit that referenced this pull request Nov 23, 2024
* โœจ feat: integrate user API for mypage

* โ™ป๏ธ refactor: improve form component for readability

* ๐Ÿ”ฅ comment: remove comment

* ๐Ÿ”ฅ remove: remove unnecessary code

* โ™ป๏ธ refactor: update FileInput types for flexibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

๐Ÿ“ฌAPI Tasks related to integrating or connecting to external APIs โœจFeature Request for a new feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] integrate user API for mypage

3 participants