reactions and a bunch of bug fixes

This commit is contained in:
Zoe
2023-01-15 23:54:38 -06:00
parent f1c5537697
commit 1cba5ea335
25 changed files with 1170 additions and 196 deletions

View File

@@ -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
})

View File

@@ -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;