Collaboration: Room chat
# feat - chatting antar user - lihat info grup ## No issue
This commit is contained in:
@@ -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
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user