-
Notifications
You must be signed in to change notification settings - Fork 7
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
#167750059 Build out the Trip-Request endpoints [CRUD] #24
base: develop
Are you sure you want to change the base?
Conversation
21200e7
to
0a06393
Compare
0a06393
to
0f0c02f
Compare
0f0c02f
to
4728815
Compare
4728815
to
e032f27
Compare
e032f27
to
e4b9cb5
Compare
e4b9cb5
to
8a4c09b
Compare
8a4c09b
to
3e2fa39
Compare
3e2fa39
to
f0093f8
Compare
f0093f8
to
5932bbd
Compare
5932bbd
to
51c036f
Compare
51c036f
to
a218a54
Compare
a218a54
to
f1825ee
Compare
f1825ee
to
dfce860
Compare
dfce860
to
4be657d
Compare
4be657d
to
9df98b1
Compare
Waoh! @funmi5 I like your PR description style. Orderly and detailed. Almost like a conversation. Well done. But please, the total coverage test is dropping by |
Thank you so much for that comment, I really appreciate it, yes I will fix it.. I was so tired yesterday night.. |
I think I helped locate where the issue is. Check lines |
Oh.. Thanks for pointing it out. I'll do that as soon as I can. |
src/controllers/roomController.js
Outdated
@@ -54,6 +54,7 @@ class RoomController { | |||
}, { where: { id: roomId } }); | |||
return successResponse(res, 200, 'Room updated'); | |||
} catch (error) { | |||
console.log(error); |
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.
@funmi5 Please remove the console.log()
statements in this file
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.
Oh yea I will, I was trying to resolve a failing test for rooms.
src/test/controllers/Trip.test.js
Outdated
await Authenticate.verifyRequest(req, res); | ||
expect(res.status).to.have.been.calledWith(500); | ||
}); | ||
// it('dept', async () => { |
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.
@funmi5 you should also remove this commented code out
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.
OK.
@funmi5 the seeded user you gave doesn't have access to the create request route. Also the error code for unauthorized should be 403 not 404. 404 means the resource was not found. |
The seeded user is kelechi and has access to the create-request route
|
9df98b1
to
1d2c3ae
Compare
- create a controller for handling trip requests - create a validation rule to handle the trip request validation - add a file to verify jsonwebtoken - create trip request services to abstract models for the trip request controller [Delivers #167750059]
1d2c3ae
to
51f7daa
Compare
What does this PR do?
This PR holds the built out CRUD endpoints for [Travel-Requests]
Description of tasks
The following endpoints should be working;
after
How should this be manually tested/checked?
let's get started
git fetch origin pull/24/head:ft-make-trip-request-167750058
TO CREATE A REQUEST
localhost:3000/api/v1/request/36da1ce3-8e1f-4b0f-8e15-1189d8231ef2
on postmanNOTE: 36da1ce3-8e1f-4b0f-8e15-1189d8231ef2 is a dept. ID which is already in our db when we seeded.
TO CREATE A TRIP
localhost:3000/api/v1/trip/<request-id>NOTE: the ID of the request you created.
Now, TO UPDATE THE TRIP YOU CREATED, when it is still pending
localhost:3000/api/v1/trip/<request-id>/<trip-id>
both the ids we got when we created a request and a tripNOW TO GET THE REQUEST YOU CREATED, since we have created a trip with the request ticket and even updated it.
localhost:3000/api/v1/request<request-id>
(the id of the request that was created)NOW TO GET ALL THE REQUESTS YOU HAVE CREATED, which is actually just one yet.
localhost:3000/api/v1/request
NOW, TO DELETE A REQUEST(TRIP) that is still pending
localhost:3000/api/v1/<request-id>
(the id of the request we createdNOW, FOR A MANAGER TO GET ALL REQUESTS
localhost:3000/api/v1/users/signin
localhost:3000/api/v1/request/manager
To query the status of any request state as a manager:
for example:
GET
localhost:3000/api/v1/request/manager?status=pending
Let us do some security checks, shall we?
1.
for manager getting requests
localhost:3000/api/v1/users/signin
localhost:3000/api/v1/request/manager
Trying to delete a trip-request that is still pending
localhost:3000/api/v1/delete
and try to deleteOther security checks you can do:
Any background context you want to provide?
What are the relevant pivotal tracker stories?
#167750058