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

In users.js file #43

Open
Asmaathabet opened this issue Aug 22, 2019 · 1 comment
Open

In users.js file #43

Asmaathabet opened this issue Aug 22, 2019 · 1 comment
Labels
question Further information is requested

Comments

@Asmaathabet
Copy link
Member

  • what it should return to me and why you handle the error by this way ???
 .catch(() => -1);

@Asmaathabet Asmaathabet added the question Further information is requested label Aug 22, 2019
@Amoodaa
Copy link
Collaborator

Amoodaa commented Aug 22, 2019

ill leave it to the presentation, tho i forgot the error the db makes, which is the reason why i did this like
the thing is, i edited the promise value, if its an error => the error is about the query result having an error because the result doesn't exist/isn't in the database
so if its an error return -1 like most of the find, indexOf functions do
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants