Resolve conflicts

This commit is contained in:
syuilo
2018-03-29 14:48:47 +09:00
parent 281b388e39
commit bfc193d8cd
308 changed files with 3045 additions and 3200 deletions

View File

@ -14,14 +14,14 @@ import { pack } from '../../models/user';
* @return {Promise<any>}
*/
module.exports = async (params, user) => new Promise(async (res, rej) => {
// Get 'post_id' parameter
const [postId, postIdErr] = $(params.post_id).id().$;
if (postIdErr) return rej('invalid post_id param');
// Get 'postId' parameter
const [postId, postIdErr] = $(params.postId).id().$;
if (postIdErr) return rej('invalid postId param');
// Fetch pinee
const post = await Post.findOne({
_id: postId,
user_id: user._id
userId: user._id
});
if (post === null) {
@ -30,7 +30,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
await User.update(user._id, {
$set: {
pinned_post_id: post._id
pinnedPostId: post._id
}
});