generated from LikeLion-13th-SKHU/LikeLion-13th-Assignment-Template
-
Notifications
You must be signed in to change notification settings - Fork 7
14주차 Assignment - 이아림 #6
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
Open
rimedang
wants to merge
3
commits into
LikeLion-13th-SKHU:main
Choose a base branch
from
rimedang:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hayoon07
approved these changes
Nov 15, 2025
hayoon07
left a comment
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.
과제 통과입니당~
어떤 부분에서 오류가 났었는지 어떻게 해결했는지 궁금하네용
고생하셨습니다~~
Comment on lines
+14
to
+44
| .get(`${API_URL}/users?_limit=5`) //테스트 API에서 게시글 5개 가져오기 | ||
| .then((res) => setUsers(res.data)) // 받아온 데이터를 posts 상태에 저장 | ||
| .catch((err) => console.error(err)); | ||
| }, [API_URL]); | ||
|
|
||
| const addUser = (newUser) => { | ||
| // 이름 변경 (newUser는 name, email 객체) | ||
| axios | ||
| .post(`${API_URL}/users`, newUser) // users 엔드포인트 | ||
| .then((res) => setUsers((prev) => [res.data, ...prev])); // setUsers | ||
| }; | ||
|
|
||
| const updateUser = (updatedUser) => { | ||
| // 이름 변경 | ||
| axios | ||
| .patch( | ||
| `${API_URL}/users/${updatedUser.id}`, // users 엔드포인트 | ||
| updatedUser | ||
| ) | ||
| .then((res) => { | ||
| setUsers( | ||
| (prev) => prev.map((u) => (u.id === updatedUser.id ? res.data : u)) // p -> u | ||
| ); | ||
| }); | ||
| }; | ||
|
|
||
| // DELETE: 게시글 삭제 | ||
| const deleteUser = (id) => { | ||
| // 이름 변경 | ||
| axios | ||
| .delete(`${API_URL}/users/${id}`) // users 엔드포인트 |
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.
💯
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Important content
Question
Reference
Image