@@ -503,17 +503,9 @@ export class ChannelStartupService {
503503 where [ 'remoteJid' ] = remoteJid ;
504504 }
505505
506- const contactFindManyArgs : Prisma . ContactFindManyArgs = {
506+ return await this . prismaRepository . contact . findMany ( {
507507 where,
508- } ;
509-
510- if ( query . offset ) contactFindManyArgs . take = query . offset ;
511- if ( query . page ) {
512- const validPage = Math . max ( query . page as number , 1 ) ;
513- contactFindManyArgs . skip = query . offset * ( validPage - 1 ) ;
514- }
515-
516- return await this . prismaRepository . contact . findMany ( contactFindManyArgs ) ;
508+ } ) ;
517509 }
518510
519511 public cleanMessageData ( message : any ) {
@@ -682,13 +674,6 @@ export class ChannelStartupService {
682674 : createJid ( query . where ?. remoteJid )
683675 : null ;
684676
685- const limit =
686- query . offset && ! query . page
687- ? Prisma . sql ` LIMIT ${ query . offset } `
688- : query . offset && query . page
689- ? Prisma . sql ` LIMIT ${ query . offset } OFFSET ${ ( ( query . page as number ) - 1 ) * query . offset } `
690- : Prisma . sql `` ;
691-
692677 const where = {
693678 instanceId : this . instanceId ,
694679 } ;
@@ -715,7 +700,6 @@ export class ChannelStartupService {
715700 to_timestamp("Message"."messageTimestamp"::double precision),
716701 "Contact"."updatedAt"
717702 ) as "updatedAt",
718- "Chat"."name" as "chatName",
719703 "Chat"."createdAt" as "windowStart",
720704 "Chat"."createdAt" + INTERVAL '24 hours' as "windowExpires",
721705 CASE
@@ -746,7 +730,6 @@ export class ChannelStartupService {
746730 ORDER BY
747731 "Contact"."remoteJid",
748732 "Message"."messageTimestamp" DESC
749- ${ limit }
750733 )
751734 SELECT * FROM rankedMessages
752735 ORDER BY "updatedAt" DESC NULLS LAST;
@@ -775,7 +758,6 @@ export class ChannelStartupService {
775758 id : contact . id ,
776759 remoteJid : contact . remoteJid ,
777760 pushName : contact . pushName ,
778- chatName : contact . chatName ,
779761 profilePicUrl : contact . profilePicUrl ,
780762 updatedAt : contact . updatedAt ,
781763 windowStart : contact . windowStart ,
0 commit comments