fix typo
This commit is contained in:
parent
ea0aa2c40d
commit
efa5e9d546
@ -8,15 +8,15 @@ import { RequestHandler } from "express";
|
|||||||
export const addIgnoredUserController: RequestHandler = async (req, res) => {
|
export const addIgnoredUserController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const data = getJSONfromString<IAddIgnoredUserRequest>(String(req.body));
|
const data = getJSONfromString<IAddIgnoredUserRequest>(String(req.body));
|
||||||
const ignoreeAcount = await Account.findOne(
|
const ignoreeAccount = await Account.findOne(
|
||||||
{ DisplayName: data.playerName.substring(0, data.playerName.length - 1) },
|
{ DisplayName: data.playerName.substring(0, data.playerName.length - 1) },
|
||||||
"_id"
|
"_id"
|
||||||
);
|
);
|
||||||
if (ignoreeAcount) {
|
if (ignoreeAccount) {
|
||||||
await Ignore.create({ ignorer: accountId, ignoree: ignoreeAcount._id });
|
await Ignore.create({ ignorer: accountId, ignoree: ignoreeAccount._id });
|
||||||
res.json({
|
res.json({
|
||||||
Ignored: {
|
Ignored: {
|
||||||
_id: toOid(ignoreeAcount._id),
|
_id: toOid(ignoreeAccount._id),
|
||||||
DisplayName: data.playerName
|
DisplayName: data.playerName
|
||||||
} satisfies IFriendInfo
|
} satisfies IFriendInfo
|
||||||
});
|
});
|
||||||
|
@ -6,12 +6,12 @@ import { RequestHandler } from "express";
|
|||||||
export const removeIgnoredUserController: RequestHandler = async (req, res) => {
|
export const removeIgnoredUserController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountForRequest(req);
|
const accountId = await getAccountForRequest(req);
|
||||||
const data = getJSONfromString<IRemoveIgnoredUserRequest>(String(req.body));
|
const data = getJSONfromString<IRemoveIgnoredUserRequest>(String(req.body));
|
||||||
const ignoreeAcount = await Account.findOne(
|
const ignoreeAccount = await Account.findOne(
|
||||||
{ DisplayName: data.playerName.substring(0, data.playerName.length - 1) },
|
{ DisplayName: data.playerName.substring(0, data.playerName.length - 1) },
|
||||||
"_id"
|
"_id"
|
||||||
);
|
);
|
||||||
if (ignoreeAcount) {
|
if (ignoreeAccount) {
|
||||||
await Ignore.deleteOne({ ignorer: accountId, ignoree: ignoreeAcount._id });
|
await Ignore.deleteOne({ ignorer: accountId, ignoree: ignoreeAccount._id });
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user