reactions and a bunch of bug fixes
This commit is contained in:
@@ -61,8 +61,69 @@ export default defineEventHandler(async (event) => {
|
||||
id: server.id
|
||||
}
|
||||
}
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
server: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
participants: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
},
|
||||
channels: {
|
||||
select: {
|
||||
id: true,
|
||||
DM: true,
|
||||
name: true
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
select: {
|
||||
id: true,
|
||||
body: true,
|
||||
creator: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
},
|
||||
invites: {
|
||||
select: {
|
||||
id: true,
|
||||
server: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
participants: {
|
||||
select: {
|
||||
id: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
DM: true,
|
||||
dmParticipants: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
},
|
||||
serverId: true,
|
||||
}
|
||||
}) as IChannel
|
||||
|
||||
global.io.emit(`addChannel-${server.id}`, channel)
|
||||
|
||||
return channel
|
||||
})
|
||||
@@ -21,10 +21,63 @@ export default defineEventHandler(async (event) => {
|
||||
where: {
|
||||
id: event.context.params.id
|
||||
},
|
||||
include: {
|
||||
participants: true,
|
||||
channels: true,
|
||||
roles: true
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
participants: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
},
|
||||
channels: {
|
||||
select: {
|
||||
id: true,
|
||||
DM: true,
|
||||
name: true,
|
||||
messages: {
|
||||
select: {
|
||||
id: true,
|
||||
body: true,
|
||||
creator: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
},
|
||||
invites: {
|
||||
select: {
|
||||
id: true,
|
||||
server: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
participants: {
|
||||
select: {
|
||||
id: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
select: {
|
||||
id: true,
|
||||
emoji: true,
|
||||
count: true,
|
||||
users: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}) as IServer | null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user