-
Notifications
You must be signed in to change notification settings - Fork 28
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
Panji-Satria #6
base: master
Are you sure you want to change the base?
Panji-Satria #6
Conversation
Link Deploy |
|
} | ||
}) | ||
.then (() => { | ||
arrTemp.push(addMember) |
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.
ga ada di cek apakah member sudah ada atau belum
if (result.OwnerId == OwnerId) { | ||
return true | ||
} else { | ||
err = new Error (`You're unathorized to add member`) |
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.
ini kenapa ga di middleware
}) | ||
.catch (() => { | ||
let err | ||
err = new Error('Data Not Found') |
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.
catch disini kan errornya bukan karena data not found
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.
(catch controller yg lain jg ya)
let arrTemp = [] | ||
Project.findById(id) | ||
.then (result => { | ||
for (let i = 0; i < result.ToDoId.length; i++) { |
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.
coba baca yang match an array disini https://docs.mongodb.com/manual/tutorial/query-arrays/
}) | ||
.then (data => { | ||
if (data.length > 0) { | ||
for (let el in 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.
jangan gini lagi dong coba baca https://docs.mongodb.com/manual/reference/operator/query/regex/
}) | ||
} | ||
|
||
static updateStatus (req, res, next) { |
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.
update status dan update todo bisa jadi 1
res.status(200).json({token}) | ||
}) | ||
.catch (() => { | ||
err = new Error('Login Failure, Something Wrong With Connection') |
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.
di next aja errornya
.env
SALT=2
SECRET="FancyToDo"
GOOGLE_CLIENT_ID='291856601506-pctu3kf6427nn8527jqa0a9tlv5i1s7f.apps.googleusercontent.com'
MONGOOSE_URL='mongodb://localhost/FancyToDo'
WEATHER_API_KEY=91df2eb8b58b2d1d29e0f869d4fe46ee