Conversation
YanaP1312
commented
Mar 11, 2026
- Added curl scripts for API operations (POST, GET, PATCH, DELETE).
- Implemented optional query parameters in the Nobel Prizes API URL.
📝 HackYourFuture auto gradeAssignment Score: 100 / 100 ✅Status: ✅ Passed Test Details |
| @@ -0,0 +1,6 @@ | |||
| #!/bin/bash | |||
|
|
|||
| id=$(cat task-1/id.txt) | |||
There was a problem hiding this comment.
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) | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) | |||
There was a problem hiding this comment.
there is a problem With this line, please review my feedback
JQnetherlands
left a comment
There was a problem hiding this comment.
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
Cannot DELETE /users/➜ task-1