Skip to content

adding query,facts,video functions#4

Open
artiJangra wants to merge 2 commits intomasterfrom
query
Open

adding query,facts,video functions#4
artiJangra wants to merge 2 commits intomasterfrom
query

Conversation

@artiJangra
Copy link
Collaborator

No description provided.

//<--------Random Fact Generation---------->
//Generates random fact about techspardha.
exports.randomFact = functions.https.onRequest((request , response) => {
const numberOfLines = 8;
Copy link
Owner

@devgrpnitkkr devgrpnitkkr Sep 30, 2018

Choose a reason for hiding this comment

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

Remember to change it as per the number of facts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay.

});
});
});
response.status(401).json(items);
Copy link
Owner

Choose a reason for hiding this comment

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

I think directly returning snapshot.val() should work. no need to iterate and make separate object

//only add newly asked query to the database.
exports.addQuery = functions.https.onRequest((request,response)=>{
const query = request.query.text;
var newPostKey = admin.database().ref().child('queries').push().key;
Copy link
Owner

Choose a reason for hiding this comment

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

validate query if not null.
Need to add captcha validation.
Directly push into reference, why building a separate object?

Copy link
Owner

@devgrpnitkkr devgrpnitkkr left a comment

Choose a reason for hiding this comment

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

Add caching also

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.

3 participants