From 97df3091fff2e17debb97eefff61375ad9051c8f Mon Sep 17 00:00:00 2001 From: lambiengcode Date: Tue, 30 Jul 2024 21:48:37 +0700 Subject: [PATCH] fix(message): change limit to take and update proto to send createdAt through grpc as a string instead of int32 --- package.json | 2 +- src/features/chat/chat.service.ts | 2 +- src/services/chat.proto.service.ts | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 9451868..0038236 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "rxjs": "^7.8.1", "typeorm": "^0.3.20", "typesense": "^1.8.2", - "waterbus-proto": "^1.1.4" + "waterbus-proto": "^1.1.5" }, "resolutions": { "inquirer": "^8.0.0" diff --git a/src/features/chat/chat.service.ts b/src/features/chat/chat.service.ts index cb83fc3..81cd2e8 100644 --- a/src/features/chat/chat.service.ts +++ b/src/features/chat/chat.service.ts @@ -44,7 +44,7 @@ export class ChatsService { }) .orderBy('message.createdAt', 'DESC') .skip(query.skip) - .limit(query.limit) + .take(query.limit) .getMany(); } diff --git a/src/services/chat.proto.service.ts b/src/services/chat.proto.service.ts index 6c912e5..6af5ace 100644 --- a/src/services/chat.proto.service.ts +++ b/src/services/chat.proto.service.ts @@ -247,8 +247,8 @@ export class ChatGrpcClientService implements OnModuleInit { status: message.status, meeting: message.meeting.id, ccus: ccus, - createdAt: message.createdAt.getTime(), - updatedAt: message.updatedAt.getTime(), + createdAt: message.createdAt.getTime().toString(), + updatedAt: message.updatedAt.getTime().toString(), createdBy: { id: message.createdBy.id, userName: message.createdBy.userName, diff --git a/yarn.lock b/yarn.lock index 3313ea5..94ac7d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6256,10 +6256,10 @@ watchpack@^2.4.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -waterbus-proto@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/waterbus-proto/-/waterbus-proto-1.1.4.tgz#6fc3add2309a52054d9aa3aee6c64a810b78d011" - integrity sha512-kY08Me8Iwp6w7N2fMXj/pB70dkJjd4ntpsQ/kXscf9cKavs0d/UTKLcQ9BPYOhiERx134iDuV5NYKislPkAYCg== +waterbus-proto@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/waterbus-proto/-/waterbus-proto-1.1.5.tgz#5e95d06caa493c328c325e4b5857ad205a4e18d6" + integrity sha512-8OIPP/k1MeG2fixceQbKhGJk5Cff9dmjVWmzeSvYyy6jvM//WaXxGhpLZxnXOR6xESQe+9rlZGZcMF+w6Tqh8A== dependencies: "@grpc/grpc-js" "^1.9.3" rxjs "^7.8.1"