Collaboration: Room chat

# feat
- chatting antar user
- lihat info grup
## No issue
This commit is contained in:
2024-04-29 10:30:59 +08:00
parent 2929459e95
commit 2a4d2951af
25 changed files with 366 additions and 162 deletions

View File

@@ -3,22 +3,35 @@
import prisma from "@/app/lib/prisma";
export default async function colab_getListAnggotaByRoomId(roomId: string) {
const get = await prisma.projectCollaboration_RoomChat.findMany({
const get = await prisma.projectCollaboration_RoomChat.findFirst({
where: {
id: roomId,
},
select: {
id: true,
name: true,
ProjectCollaboration: true,
ProjectCollaboration: {
select: {
id: true,
isActive: true,
title: true,
lokasi: true,
purpose: true,
benefit: true,
createdAt: true,
ProjectCollaborationMaster_Industri: true,
},
},
ProjectCollaboration_AnggotaRoomChat: {
select: {
User: {
select: {
id: true,
Profile: {
select: {
id: true,
name: true,
imagesId: true
},
},
},

View File

@@ -5,8 +5,9 @@ import prisma from "@/app/lib/prisma";
export default async function colab_getMessageByRoomId(roomId: string) {
const getList = await prisma.projectCollaboration_Message.findMany({
orderBy: {
createdAt: "asc",
createdAt: "desc",
},
take : 8,
where: {
projectCollaboration_RoomChatId: roomId,
},