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

added onlyForFemale field #76

Closed

Conversation

ritik307
Copy link
Contributor

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ritik307 ritik307 marked this pull request as draft April 27, 2021 06:17
@ritik307 ritik307 marked this pull request as ready for review April 27, 2021 16:01
@ritik307
Copy link
Contributor Author

@Manvityagi Plz review

Copy link
Member

@Manvityagi Manvityagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There are merge conflicts that you need to resolve.
  2. I don't see the corresponding updates in tests

@ritik307
Copy link
Contributor Author

1. There are merge conflicts that you need to resolve.

2. I don't see the corresponding updates in `tests`

will fix that asap

@ritik307
Copy link
Contributor Author

@Manvityagi Done Plz check

Copy link
Member

@Manvityagi Manvityagi left a 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

@@ -3,6 +3,7 @@ class opportunityService {
this.opportunityManager = opportunityManager;
}
async createOpportunity(
opportunityId,
Copy link
Member

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

@@ -18,6 +19,7 @@ class opportunityService {

try {
let newOpportunity = await this.opportunityManager.createOpportunity(
opportunityId,
Copy link
Member

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
Copy link
Member

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.

@ritik307
Copy link
Contributor Author

ritik307 commented May 1, 2021

@Manvityagi @abdus Plz review

@ritik307 ritik307 requested a review from Manvityagi May 1, 2021 17:51
@Manvityagi
Copy link
Member

@ritik307 The build fails on your PR.
Run your code & tests locally and fix the issue.
You can see the build log by clicking on the Travis details link in checks and see what's causing the build to fail.

@ritik307
Copy link
Contributor Author

ritik307 commented May 1, 2021

@Manvityagi Plz review

Copy link
Member

@Manvityagi Manvityagi left a 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

@ritik307
Copy link
Contributor Author

ritik307 commented May 2, 2021

@Manvityagi Done! Kindly review

@ritik307 ritik307 requested a review from Manvityagi May 2, 2021 08:15
@@ -54,6 +54,17 @@ class opportunityManager {
queryObject['opportunityType'] = queryObject.type;
delete queryObject.type;
}
if (queryObject.female) {
queryObject['onlyForFemale'] = queryObject.female == 'true';
Copy link
Member

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 ==.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

let fetchedOpportunitiesQuery = this.opportunity.find(queryObject);
// fetchedOpportunitiesQuery.select('-__v');
// fetchedOpportunitiesQuery.select('-_id');
console.log(fetchedOpportunitiesQuery.data);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@ritik307 ritik307 requested a review from abdus May 4, 2021 18:02
@ritik307
Copy link
Contributor Author

ritik307 commented May 4, 2021

@abdus Done! Plz review

@abdus
Copy link
Member

abdus commented May 8, 2021

@ritik307 please solve the merge conflict. I aim to accept/reject this PR by this weekend. It has been here for a long time.

@ritik307
Copy link
Contributor Author

ritik307 commented May 8, 2021

@abdus Plz review
Just a matter of fact I always make the requested changes within a day or two but they didn't get a review for weeks.

@abdus
Copy link
Member

abdus commented May 8, 2021

the pagination thing is missing. I am attaching screenshots so that it's easier for you to understand.

Frame 1

sorry about being late. less free time than before.

@ritik307
Copy link
Contributor Author

ritik307 commented May 8, 2021

@abdus My task was to add onlyforfemale field.

@abdus
Copy link
Member

abdus commented May 8, 2021

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.

delete queryObject.type;
}
if (queryObject.female) {
queryObject['onlyForFemale'] = queryObject.female === 'true';
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@ritik307
Copy link
Contributor Author

ritik307 commented May 8, 2021

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.

can you plz elaborate which js-doc you are talking about?

Comment on lines 138 to 148
* 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@ritik307
Copy link
Contributor Author

ritik307 commented May 8, 2021

@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.

@abdus
Copy link
Member

abdus commented May 9, 2021

did you actually test the code after pushing? the GET for opportunity is missing from swagger. after making changes, please go to localhost:3030/playground and check whether your code is actually working or not.

@abdus
Copy link
Member

abdus commented May 14, 2021

@ritik307 any updates?

@abdus
Copy link
Member

abdus commented May 16, 2021

participant inactive. closing...

@abdus abdus closed this May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update getAPI queryObject
3 participants