mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
do not allow to create room with self
This commit is contained in:
parent
1ee2dc70bb
commit
073adbe48c
@ -32,6 +32,9 @@ export default {
|
||||
const {
|
||||
user: { id: currentUserId },
|
||||
} = context
|
||||
if (userId === currentUserId) {
|
||||
throw new Error('Cannot create a room with yourself')
|
||||
}
|
||||
const session = context.driver.session()
|
||||
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
|
||||
const createRoomCypher = `
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user