Skip to content

Yana P.#13

Open
YanaP1312 wants to merge 3 commits intoHackYourAssignment:mainfrom
YanaP1312:main
Open

Yana P.#13
YanaP1312 wants to merge 3 commits intoHackYourAssignment:mainfrom
YanaP1312:main

Conversation

@YanaP1312
Copy link

  1. Added curl scripts for API operations (POST, GET, PATCH, DELETE).
  2. Implemented optional query parameters in the Nobel Prizes API URL.

@github-actions
Copy link

📝 HackYourFuture auto grade

Assignment Score: 100 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 50
🧪 The auto grade is experimental and still being improved

Test Details
Vitest unit test results:

✅ post.sh: Script exists
✅ post.sh: Create user John Doe
✅ patch.sh: Script exists
✅ patch.sh: Correct the email address
✅ get.sh: Script exists
✅ get.sh: Retrieve user John Doe details
✅ delete.sh: Script exists
✅ delete.sh: Delete user John Doe
✅ get.sh: Verify user John Doe has been deleted
✅ Uses the correct base URL
✅ URL includes the nobelPrizeYear query parameter
✅ URL includes the nobelPrizeCategory query parameter
✅ URL includes the offset query parameter
✅ URL includes the limit query parameter
✅ Omits the nobelPrizeYear when set to "all"
✅ Omits the nobelPrizeCategory when set to "all"
✅ Includes the sort query parameter set to desc

Total passed: 17
Total failed: 0
Killed

@JQnetherlands JQnetherlands self-assigned this Mar 12, 2026
@JQnetherlands JQnetherlands self-requested a review March 12, 2026 11:01
@@ -0,0 +1,6 @@
#!/bin/bash

id=$(cat task-1/id.txt)

Choose a reason for hiding this comment

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

There is a problem in this line, please review my feedback for more insight

@@ -0,0 +1,6 @@
#!/bin/bash

id=$(cat task-1/id.txt)

Choose a reason for hiding this comment

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

There is a problem in this line, please review my feedback for more insight


id=$(echo "$id_line" | tr -cd '0-9')

echo "$id" > task-1/id.txt

Choose a reason for hiding this comment

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

There is a problem in this line, please review my feedback for more insight

@@ -0,0 +1,7 @@
#!/bin/bash

id=$(cat task-1/id.txt)

Choose a reason for hiding this comment

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

there is a problem With this line, please review my feedback

Copy link

@JQnetherlands JQnetherlands left a comment

Choose a reason for hiding this comment

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

Hello Yana,

I will start with the good news, you have successfully passed the task 2 , you code for that task works as intended. I see you are very creative and you found your own way of solving the exercise, you did not follow through the advice of the project to use URLSearchParams, even if your way worked I suggest to read the documentation about URLSearchParams, you will see that it will strength your knowledge, for example I would have done something very similar to you myself, but after reading the documentation to evaluate this project I learned myself something new,

if you have time free please consider using URLSearchParams for your own learning. As a developer you can always learn a new way to accomplish the same normally this will help you in the future, as each way has advantages and disadvantages.

Respecting task 1 , it did not passed , I paste here the log of my terminal so you can debug the reason why it doesn't work:. I had to change 4 lines of your code myself to make it work, that is the reason that for the sack of learning I ask you kindly to find the bug and make your code work as intended, you are very near, you need to make 4 changes in total!

➜ task-1 bash post.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 340 100 202 100 138 1526 1042 --:--:-- --:--:-- --:--:-- 2575
{
"id": 11,
"name": "John Doe",
"email": "john.doe@example.com",
"role": "user",
"active": true,
"createdAt": "2026-03-17T17:42:55.795Z",
"lastLogin": null,
"department": "Engineering"
}
post.sh: line 13: task-1/id.txt: No such file or directory
➜ task-1 bash get.sh
cat: task-1/id.txt: No such file or directory
[
{
"id": 1,
"name": "Alice Johnson",
"email": "alice.johnson@example.com",
"role": "admin",
"active": true,
"createdAt": "2024-01-15T08:30:00Z",
"lastLogin": "2026-02-03T10:45:00Z",
"department": "Engineering"
},
{
"id": 2,
"name": "Bob Smith",
"email": "bob.smith@example.com",
"role": "user",
"active": true,
"createdAt": "2024-02-20T09:15:00Z",
"lastLogin": "2026-02-02T14:22:00Z",
"department": "Marketing"
},
{
"id": 3,
"name": "Carol Williams",
"email": "carol.williams@example.com",
"role": "moderator",
"active": true,
"createdAt": "2024-03-10T11:00:00Z",
"lastLogin": "2026-02-01T09:30:00Z",
"department": "Content"
},
{
"id": 4,
"name": "David Brown",
"email": "david.brown@example.com",
"role": "user",
"active": false,
"createdAt": "2024-04-05T13:45:00Z",
"lastLogin": "2025-11-28T16:20:00Z",
"department": "Sales"
},
{
"id": 5,
"name": "Emma Davis",
"email": "emma.davis@example.com",
"role": "admin",
"active": true,
"createdAt": "2024-01-08T07:20:00Z",
"lastLogin": "2026-02-03T08:15:00Z",
"department": "Engineering"
},
{
"id": 6,
"name": "Frank Miller",
"email": "frank.miller@example.com",
"role": "user",
"active": true,
"createdAt": "2024-05-12T10:30:00Z",
"lastLogin": "2026-01-31T12:00:00Z",
"department": "HR"
},
{
"id": 7,
"name": "Grace Lee",
"email": "grace.lee@example.com",
"role": "moderator",
"active": true,
"createdAt": "2024-06-18T14:15:00Z",
"lastLogin": "2026-02-02T15:45:00Z",
"department": "Content"
},
{
"id": 8,
"name": "Henry Taylor",
"email": "henry.taylor@example.com",
"role": "user",
"active": false,
"createdAt": "2024-07-22T16:00:00Z",
"lastLogin": "2025-12-15T11:30:00Z",
"department": "Finance"
},
{
"id": 9,
"name": "Iris Anderson",
"email": "iris.anderson@example.com",
"role": "user",
"active": true,
"createdAt": "2024-08-05T09:45:00Z",
"lastLogin": "2026-02-03T11:20:00Z",
"department": "Marketing"
},
{
"id": 10,
"name": "Jack Wilson",
"email": "jack.wilson@example.com",
"role": "moderator",
"active": true,
"createdAt": "2024-09-14T12:30:00Z",
"lastLogin": "2026-02-03T13:00:00Z",
"department": "Engineering"
},
{
"id": 11,
"name": "John Doe",
"email": "john.doe@example.com",
"role": "user",
"active": true,
"createdAt": "2026-03-17T17:42:55.795Z",
"lastLogin": null,
"department": "Engineering"
}
]%
➜ task-1 bash delete.sh
cat: task-1/id.txt: No such file or directory

<title>Error</title>
Cannot DELETE /users/
➜ task-1

@JQnetherlands JQnetherlands added Review in progress Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed Review in progress labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants