fix: 遗漏的 return
This commit is contained in:
@@ -267,7 +267,10 @@ export default class ChatApi extends BaseApi {
|
|||||||
const user = User.findById(token.author) as User
|
const user = User.findById(token.author) as User
|
||||||
|
|
||||||
const haveId = args.id && (args.id as string) != ''
|
const haveId = args.id && (args.id as string) != ''
|
||||||
if (haveId && Chat.findById(args.id as string) != null) return
|
if (haveId && Chat.findById(args.id as string) != null) return {
|
||||||
|
msg: "对话 ID 已被占用",
|
||||||
|
code: 403,
|
||||||
|
}
|
||||||
|
|
||||||
const chat = ChatGroup.createGroup(haveId ? undefined : args.id as string)
|
const chat = ChatGroup.createGroup(haveId ? undefined : args.id as string)
|
||||||
chat.setTitle(args.title as string)
|
chat.setTitle(args.title as string)
|
||||||
|
|||||||
Reference in New Issue
Block a user