summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-08 05:02:50 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-08 05:02:50 +0900
commit5ddb047794bb3aaef250c15dfbae56872faedfd9 (patch)
tree341f26c4b48054c3ee89143f6f8786210c1484d0 /src/server
parentFix bugs (diff)
downloadsharkey-5ddb047794bb3aaef250c15dfbae56872faedfd9.tar.gz
sharkey-5ddb047794bb3aaef250c15dfbae56872faedfd9.tar.bz2
sharkey-5ddb047794bb3aaef250c15dfbae56872faedfd9.zip
Fix bugs
Diffstat (limited to 'src/server')
-rw-r--r--src/server/api/endpoints/following/create.ts2
-rw-r--r--src/server/api/endpoints/i/update.ts24
-rw-r--r--src/server/api/endpoints/users/notes.ts (renamed from src/server/api/endpoints/users/posts.ts)0
3 files changed, 5 insertions, 21 deletions
diff --git a/src/server/api/endpoints/following/create.ts b/src/server/api/endpoints/following/create.ts
index d3cc549ca7..0a642f50b2 100644
--- a/src/server/api/endpoints/following/create.ts
+++ b/src/server/api/endpoints/following/create.ts
@@ -31,7 +31,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}, {
fields: {
data: false,
- 'profile': false
+ profile: false
}
});
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index a8caa0ebc4..36be2774f6 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -4,7 +4,6 @@
import $ from 'cafy';
import User, { isValidName, isValidDescription, isValidLocation, isValidBirthday, pack } from '../../../../models/user';
import event from '../../../../publishers/stream';
-import config from '../../../../config';
/**
* Update myself
@@ -17,7 +16,7 @@ import config from '../../../../config';
*/
module.exports = async (params, user, _, isSecure) => new Promise(async (res, rej) => {
// Get 'name' parameter
- const [name, nameErr] = $(params.name).optional.string().pipe(isValidName).$;
+ const [name, nameErr] = $(params.name).optional.nullable.string().pipe(isValidName).$;
if (nameErr) return rej('invalid name param');
if (name) user.name = name;
@@ -62,9 +61,9 @@ module.exports = async (params, user, _, isSecure) => new Promise(async (res, re
description: user.description,
avatarId: user.avatarId,
bannerId: user.bannerId,
- 'profile': user.profile,
- 'isBot': user.isBot,
- 'settings': user.settings
+ profile: user.profile,
+ isBot: user.isBot,
+ settings: user.settings
}
});
@@ -79,19 +78,4 @@ module.exports = async (params, user, _, isSecure) => new Promise(async (res, re
// Publish i updated event
event(user._id, 'i_updated', iObj);
-
- // Update search index
- if (config.elasticsearch.enable) {
- const es = require('../../../db/elasticsearch');
-
- es.index({
- index: 'misskey',
- type: 'user',
- id: user._id.toString(),
- body: {
- name: user.name,
- bio: user.bio
- }
- });
- }
});
diff --git a/src/server/api/endpoints/users/posts.ts b/src/server/api/endpoints/users/notes.ts
index f9f6345e34..f9f6345e34 100644
--- a/src/server/api/endpoints/users/posts.ts
+++ b/src/server/api/endpoints/users/notes.ts