feat: user exist route in write api

This commit is contained in:
Julian Lam
2020-11-06 11:55:04 -05:00
parent 6b196a207f
commit 1446cec77f
4 changed files with 28 additions and 21 deletions

View File

@@ -30,6 +30,8 @@ require('./user/ban')(SocketUser);
require('./user/registration')(SocketUser);
SocketUser.exists = async function (socket, data) {
sockets.warnDeprecated(socket, 'HEAD /api/v3/users/bySlug/:userslug');
if (!data || !data.username) {
throw new Error('[[error:invalid-data]]');
}