Skip to content
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

Updated the logic to return 404 instead of 200 when wrong taskRequest Id is sent #2296

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions models/taskRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,16 @@
const taskRequestSnapshot = await taskRequestsCollection.doc(taskRequestId).get();
const taskRequestData = taskRequestSnapshot.data();

if (taskRequestData) {
taskRequestData.id = taskRequestSnapshot.id;
taskRequestData.url = new URL(`/taskRequests/${taskRequestData.id}`, config.get("services.rdsUi.baseUrl"));
if (!taskRequestData){

Check failure on line 174 in models/taskRequests.js

View workflow job for this annotation

GitHub Actions / build (20.11.x)

Insert `·`
return {
taskRequestData,
Akshat187 marked this conversation as resolved.
Show resolved Hide resolved
taskRequestExists: false,
};
}

Check failure on line 180 in models/taskRequests.js

View workflow job for this annotation

GitHub Actions / build (20.11.x)

Trailing spaces not allowed

Check failure on line 180 in models/taskRequests.js

View workflow job for this annotation

GitHub Actions / build (20.11.x)

Delete `····`
taskRequestData.id = taskRequestSnapshot.id;
taskRequestData.url = new URL(`/taskRequests/${taskRequestData.id}`, config.get("services.rdsUi.baseUrl"));

return {
taskRequestData,
taskRequestExists: true,
Expand Down
Loading