File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/routes/copilotRequest Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,18 @@ module.exports = [
3535
3636 const whereCondition = projectId ? { projectId } : { } ;
3737
38- return models . CopilotRequest . findAll ( {
38+ return models . CopilotRequest . findAndCountAll ( {
3939 where : whereCondition ,
4040 include : [
4141 { model : models . CopilotOpportunity , as : 'copilotOpportunity' , required : false } ,
4242 ] ,
4343 order : [ [ sortParams [ 0 ] , sortParams [ 1 ] ] ] ,
4444 limit : pageSize ,
4545 offset,
46- } ) . then ( ( copilotRequests ) => util . setPaginationHeaders ( req , res , {
47- count : copilotRequests . count ,
46+ distinct : true ,
47+ subQuery : false ,
48+ } ) . then ( ( copilotRequests , count ) => util . setPaginationHeaders ( req , res , {
49+ count : count ,
4850 rows : copilotRequests ,
4951 page,
5052 pageSize,
You can’t perform that action at this time.
0 commit comments