Skip to content

Task 7: NoSQL DATABASES. ODM#7

Open
aleksandra-sturova wants to merge 4 commits intomasterfrom
task-7
Open

Task 7: NoSQL DATABASES. ODM#7
aleksandra-sturova wants to merge 4 commits intomasterfrom
task-7

Conversation

@aleksandra-sturova
Copy link
Owner

No description provided.

const allowAccess = currentUserData && currentUserData.password === password;

if (allowAccess) {
const token = jwt.sign({ userName }, 'secret13', { expiresIn: 10000 });

Choose a reason for hiding this comment

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

'secret13', { expiresIn: 10000 }

Export into config file, pls


City.findOneAndRemove({ id }, (err, city) => {
if (!city) {
res.status(400).send({ message: 'City not found' });

Choose a reason for hiding this comment

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

Uses 404 status code if data doesn't found, pls

City.findOneAndUpdate({ id }, update, { new: true }, (err, city) => {
console.log('!!!!!!!', city);
if (!city) {
res.status(400).send({ message: 'City not found' });

Choose a reason for hiding this comment

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

^^


Product.findOneAndRemove({ id }, (err, product) => {
if (!product) {
res.status(400).send({ message: 'Product not found' });

Choose a reason for hiding this comment

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

^^


User.findOneAndRemove({ id }, (err, user) => {
if (!user) {
res.status(400).send({ message: 'User not found' });

Choose a reason for hiding this comment

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

^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants