summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-03-26 14:51:03 +0900
committerGitHub <noreply@github.com>2018-03-26 14:51:03 +0900
commit8d7d200efffcf9ffd49dba28f729a6e5b9c11f68 (patch)
tree10e3209cd77c3a08b488c08bd4b2f9d7e87de974 /src/api/endpoints/posts
parentMerge pull request #1293 from rinsuki/fix/using-hostname-insteadof-host (diff)
parentIntroduce account document to user document (diff)
downloadsharkey-8d7d200efffcf9ffd49dba28f729a6e5b9c11f68.tar.gz
sharkey-8d7d200efffcf9ffd49dba28f729a6e5b9c11f68.tar.bz2
sharkey-8d7d200efffcf9ffd49dba28f729a6e5b9c11f68.zip
Merge pull request #1287 from akihikodaki/account
Introduce account document to user document
Diffstat (limited to 'src/api/endpoints/posts')
-rw-r--r--src/api/endpoints/posts/categorize.ts2
-rw-r--r--src/api/endpoints/posts/create.ts2
-rw-r--r--src/api/endpoints/posts/polls/vote.ts2
-rw-r--r--src/api/endpoints/posts/reactions/create.ts2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/api/endpoints/posts/categorize.ts b/src/api/endpoints/posts/categorize.ts
index 3530ba6bc4..0c85c2b4e0 100644
--- a/src/api/endpoints/posts/categorize.ts
+++ b/src/api/endpoints/posts/categorize.ts
@@ -12,7 +12,7 @@ import Post from '../../models/post';
* @return {Promise<any>}
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
- if (!user.is_pro) {
+ if (!user.account.is_pro) {
return rej('This endpoint is available only from a Pro account');
}
diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts
index 1c3ab53457..f46a84e1f1 100644
--- a/src/api/endpoints/posts/create.ts
+++ b/src/api/endpoints/posts/create.ts
@@ -390,7 +390,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => {
});
// この投稿をWatchする
- if (user.settings.auto_watch !== false) {
+ if (user.account.settings.auto_watch !== false) {
watch(user._id, reply);
}
diff --git a/src/api/endpoints/posts/polls/vote.ts b/src/api/endpoints/posts/polls/vote.ts
index 8222fe5326..16ce76a6fa 100644
--- a/src/api/endpoints/posts/polls/vote.ts
+++ b/src/api/endpoints/posts/polls/vote.ts
@@ -100,7 +100,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
});
// この投稿をWatchする
- if (user.settings.auto_watch !== false) {
+ if (user.account.settings.auto_watch !== false) {
watch(user._id, post);
}
});
diff --git a/src/api/endpoints/posts/reactions/create.ts b/src/api/endpoints/posts/reactions/create.ts
index 93d9756d02..f77afed40c 100644
--- a/src/api/endpoints/posts/reactions/create.ts
+++ b/src/api/endpoints/posts/reactions/create.ts
@@ -116,7 +116,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
});
// この投稿をWatchする
- if (user.settings.auto_watch !== false) {
+ if (user.account.settings.auto_watch !== false) {
watch(user._id, post);
}
});