Refactor API response structure to include success status and body for all endpoints, ensuring consistent response format across the application.
Some checks failed
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit

This commit is contained in:
Primakov Alexandr Alexandrovich
2025-11-04 11:18:13 +03:00
parent 67f29c103a
commit cde28b1dd8
9 changed files with 294 additions and 265 deletions

View File

@@ -1,57 +1,60 @@
{
"queue-frontend-001": {
"status": "completed",
"position": 0,
"submission": {
"_id": "submission-001",
"id": "submission-001",
"user": "user-frontend-001",
"task": "task-html-intro",
"result": "<html><head></head><body><h1>Hello</h1></body></html>",
"status": "needs_revision",
"queueId": "queue-frontend-001",
"feedback": "Добавьте тег <title>",
"submittedAt": "2024-10-18T07:10:00.000Z",
"checkedAt": "2024-10-18T07:10:15.000Z",
"attemptNumber": 1
}
},
"queue-frontend-002": {
"status": "completed",
"position": 0,
"submission": {
"_id": "submission-002",
"id": "submission-002",
"user": "user-frontend-001",
"task": "task-html-intro",
"result": "<html><head><title>Home</title></head><body><h1>Hello</h1></body></html>",
"status": "accepted",
"queueId": "queue-frontend-002",
"feedback": "Отличная работа!",
"submittedAt": "2024-10-18T07:20:00.000Z",
"checkedAt": "2024-10-18T07:20:05.000Z",
"attemptNumber": 2
}
},
"queue-frontend-003": {
"status": "waiting",
"position": 3
},
"queue-react-001": {
"status": "completed",
"position": 0,
"submission": {
"_id": "submission-004",
"id": "submission-004",
"user": "user-react-777",
"task": "task-react-component",
"result": "export const StatCard = () => <div>Stat</div>;",
"status": "accepted",
"queueId": "queue-react-001",
"feedback": "Добавьте prop-types.",
"submittedAt": "2024-10-17T11:30:00.000Z",
"checkedAt": "2024-10-17T11:30:07.000Z",
"attemptNumber": 1
"success": true,
"body": {
"queue-frontend-001": {
"status": "completed",
"position": 0,
"submission": {
"_id": "submission-001",
"id": "submission-001",
"user": "user-frontend-001",
"task": "task-html-intro",
"result": "<html><head></head><body><h1>Hello</h1></body></html>",
"status": "needs_revision",
"queueId": "queue-frontend-001",
"feedback": "Добавьте тег <title>",
"submittedAt": "2024-10-18T07:10:00.000Z",
"checkedAt": "2024-10-18T07:10:15.000Z",
"attemptNumber": 1
}
},
"queue-frontend-002": {
"status": "completed",
"position": 0,
"submission": {
"_id": "submission-002",
"id": "submission-002",
"user": "user-frontend-001",
"task": "task-html-intro",
"result": "<html><head><title>Home</title></head><body><h1>Hello</h1></body></html>",
"status": "accepted",
"queueId": "queue-frontend-002",
"feedback": "Отличная работа!",
"submittedAt": "2024-10-18T07:20:00.000Z",
"checkedAt": "2024-10-18T07:20:05.000Z",
"attemptNumber": 2
}
},
"queue-frontend-003": {
"status": "waiting",
"position": 3
},
"queue-react-001": {
"status": "completed",
"position": 0,
"submission": {
"_id": "submission-004",
"id": "submission-004",
"user": "user-react-777",
"task": "task-react-component",
"result": "export const StatCard = () => <div>Stat</div>;",
"status": "accepted",
"queueId": "queue-react-001",
"feedback": "Добавьте prop-types.",
"submittedAt": "2024-10-17T11:30:00.000Z",
"checkedAt": "2024-10-17T11:30:07.000Z",
"attemptNumber": 1
}
}
}
}