File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
back/api/application/controllers Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,33 @@ module.exports = {
6868 const applications = await strapi . services . application . find (
6969 {
7070 id,
71- status : [ 'validated' , 'confirmed' ] ,
7271 } ,
7372 [
7473 'id' ,
74+ 'creation_title' ,
75+ 'company' ,
7576 ] ,
7677 )
7778
79+ const application = applications . length > 0 ? applications [ 0 ] : null
80+
81+ if ( ! application ) {
82+ return { count : 0 }
83+ }
84+
85+ const applicationsCount = await strapi . services . application . find (
86+ {
87+ creation_title : application . creation_title ,
88+ company : application . company . id ,
89+ status_in : [ 'validated' , 'confirmed' ] ,
90+ } ,
91+ [
92+ 'id' ,
93+ 'creation_title' ,
94+ 'company' ,
95+ ] ,
96+ )
7897
79- return { count : applications ?. length || 0 }
98+ return { count : applicationsCount ?. length || 0 }
8099 } ,
81100}
You can’t perform that action at this time.
0 commit comments