Loading Room Chat
# feat - Loading otomastis scroll chat ## No Isuuee
This commit is contained in:
@@ -45,16 +45,17 @@ export default async function colab_funCreateRoomChat(
|
||||
if (!createForAuthor)
|
||||
return { status: 400, message: "Gagal Menambahkan Author" };
|
||||
|
||||
// const hideProyek = await prisma.projectCollaboration.update({
|
||||
// where: {
|
||||
// id: colabId,
|
||||
// },
|
||||
// data: {
|
||||
// isActive: false,
|
||||
// },
|
||||
// });
|
||||
// PROJECT YANG SUDAH DI CREATE ROOM AKAN DI HIDE AGAR HANYA ADA 1 GRUP UNTUK 1 PROYEK
|
||||
const hideProyek = await prisma.projectCollaboration.update({
|
||||
where: {
|
||||
id: colabId,
|
||||
},
|
||||
data: {
|
||||
isActive: false,
|
||||
},
|
||||
});
|
||||
|
||||
// if (!hideProyek) return { status: 400, message: "Gagal Menyimpan Proyek" };
|
||||
if (!hideProyek) return { status: 400, message: "Gagal Menyimpan Proyek" };
|
||||
|
||||
return { status: 201, message: "Berhasil Membuat Room" };
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export default async function colab_getListPartisipanById(colabId: string) {
|
||||
export default async function colab_getListPartisipanByColabId(colabId: string) {
|
||||
const data = await prisma.projectCollaboration_Partisipasi.findMany({
|
||||
where: {
|
||||
projectCollaborationId: colabId,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_getListPartisipasiByAuthorId() {
|
||||
export default async function colab_getListPartisipasiProyekByAuthorId() {
|
||||
const AuthorId = await user_getOneUserId();
|
||||
|
||||
const get = await prisma.projectCollaboration_Partisipasi.findMany({
|
||||
@@ -1,13 +1,21 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function colab_getMessageByRoomId(roomId: string) {
|
||||
export default async function colab_getMessageByRoomId(
|
||||
roomId: string,
|
||||
page: number
|
||||
) {
|
||||
// console.log(page)
|
||||
const lewat = page * 5 - 5;
|
||||
const ambil = 5;
|
||||
const getList = await prisma.projectCollaboration_Message.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
take : 8,
|
||||
skip: lewat,
|
||||
take: ambil,
|
||||
where: {
|
||||
projectCollaboration_RoomChatId: roomId,
|
||||
},
|
||||
@@ -31,5 +39,7 @@ export default async function colab_getMessageByRoomId(roomId: string) {
|
||||
},
|
||||
});
|
||||
|
||||
const dataRevers = _.reverse(getList);
|
||||
|
||||
return getList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user