| 272 | } |
| 273 | |
| 274 | static async getOne({ |
| 275 | messageId, |
| 276 | }: messageGetType): Promise<messageGetResponseType> { |
| 277 | return await prisma.messages.findUnique({ |
| 278 | where: { id: messageId }, |
| 279 | select: { |
| 280 | body: true, |
| 281 | channelId: true, |
| 282 | externalMessageId: true, |
| 283 | threadId: true, |
| 284 | author: { select: { displayName: true, profileImageUrl: true } }, |
| 285 | }, |
| 286 | }); |
| 287 | } |
| 288 | |
| 289 | static async update({ messageId, body, externalMessageId }: messagePutType) { |
| 290 | // TODO: handle mentions and attachments, also slugs if is the first message |