-
Notifications
You must be signed in to change notification settings - Fork 2
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
[feat] 新增 find-task/apply/:taskId 幫手應徵功能 #123
Conversation
[fix] findTaskDetails查無對應user帳號時,報錯40200
少了推播功能 |
controller/findTaskController.js
Outdated
if (!task) { | ||
return next(appError(400, '40212', '查無此任務')); | ||
} | ||
if (task.userId._id.toString() === userId) { |
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.
userId 沒有 toString() 會錯嗎?
return next(appError(400, '40216', '無法應徵自己的任務')); | ||
} | ||
if (task.helpers.some((helper) => helper.helperId._id.toString() === userId)) { | ||
return next(appError(400, '40217', '已應徵過此任務')); |
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.
userId 沒有 toString() 會錯嗎?
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.
剛剛試了一下 沒轉型的話,比對永遠是false
你那邊有沒有類似的id比對,我想參考確認一下
[fix] 幫手應徵任務後,要發送通知給雙方
[feat] 新增 find-task/apply/:taskId 幫手應徵功能
[fix] findTaskDetails查無對應user帳號時,報錯40200