-
Notifications
You must be signed in to change notification settings - Fork 30
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
added onlyForFemale field #76
added onlyForFemale field #76
Conversation
@Manvityagi Plz review |
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.
- There are merge conflicts that you need to resolve.
- I don't see the corresponding updates in
tests
will fix that asap |
@Manvityagi Done Plz check |
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.
Please take the latest pull of code, and
fix the things mentioned in comments.
There is no field called as opportunityId
in the schema now
services/opportunity/index.js
Outdated
@@ -3,6 +3,7 @@ class opportunityService { | |||
this.opportunityManager = opportunityManager; | |||
} | |||
async createOpportunity( | |||
opportunityId, |
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.
opportunityId
field has been removed from the schema, Please remove it
services/opportunity/index.js
Outdated
@@ -18,6 +19,7 @@ class opportunityService { | |||
|
|||
try { | |||
let newOpportunity = await this.opportunityManager.createOpportunity( | |||
opportunityId, |
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.
opportunityId
field has been removed from the schema, Please remove it
@@ -30,6 +30,7 @@ const opportunityManager = new OpportunityManager(), | |||
* - SCHOLARSHIP | |||
* - CONFERENCE | |||
* - CODINGCOMPETITION | |||
* description: Retrieve a list of opportunities based on particular type or only for female. | |||
* description: Retrieve a list of opportunities based on particular type. | |||
* - in: query |
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.
In documentation also, you should add female
query parameter,
Visiting http://localhost:3030/playground/#/default/get_opportunity shall have female
parameter added.
@Manvityagi @abdus Plz review |
@ritik307 The build fails on your PR. |
@Manvityagi Plz review |
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.
Please take the latest pull and resolve merge conflicts
@Manvityagi Done! Kindly review |
managers/opportunity/index.js
Outdated
@@ -54,6 +54,17 @@ class opportunityManager { | |||
queryObject['opportunityType'] = queryObject.type; | |||
delete queryObject.type; | |||
} | |||
if (queryObject.female) { | |||
queryObject['onlyForFemale'] = queryObject.female == 'true'; |
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.
should not this be a boolean value? and please use ===
instead of ==
.
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.
Done!
managers/opportunity/index.js
Outdated
let fetchedOpportunitiesQuery = this.opportunity.find(queryObject); | ||
// fetchedOpportunitiesQuery.select('-__v'); | ||
// fetchedOpportunitiesQuery.select('-_id'); | ||
console.log(fetchedOpportunitiesQuery.data); |
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.
remove console.log
(s). makes test output untidy.
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.
Done!
@abdus Done! Plz review |
@ritik307 please solve the merge conflict. I aim to accept/reject this PR by this weekend. It has been here for a long time. |
@abdus Plz review |
@abdus My task was to add onlyforfemale field. |
possibly overridden code blocks that were responsible for pagination? looking at your commit history, it looks like you have removed part of the js-doc. |
managers/opportunity/index.js
Outdated
delete queryObject.type; | ||
} | ||
if (queryObject.female) { | ||
queryObject['onlyForFemale'] = queryObject.female === 'true'; |
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.
also, why a boolean value is written as a string?
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.
will fix that
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.
Done!
can you plz elaborate which |
routes/opportunity.js
Outdated
* name: page | ||
* name: female | ||
* schema: | ||
* type: Integer | ||
* default: 1 | ||
* description: The Current Page for which the data User Wants | ||
* - in: query | ||
* name: limit | ||
* schema: | ||
* type: Integer | ||
* default: 10 | ||
* description: The count of items/documents that should be returned on each page |
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.
this one
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.
Done!
@abdus plz review. btw I haven't removed the pagination code as far as I think the pagination code was merged before my issue that could be the reason it's missing from my PR. |
did you actually test the code after pushing? the |
@ritik307 any updates? |
participant inactive. closing... |
Description
The GET API currently can now filter on the basis of onlyForFemale field.
Fixes #69
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: