File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,10 @@ export function createProject(newProject) {
203203 *
204204 * @returns {Promise<[]> } list of products
205205 */
206- function getAllProjectProducts ( project ) {
207- return getProjectPhasesWithProducts ( project . id )
208- . then ( ( phases ) => _ . flatten ( _ . map ( phases , 'products' ) ) )
209- }
206+ // function getAllProjectProducts(project, fromDB = false ) {
207+ // return getProjectPhasesWithProducts(project.id, fromDB )
208+ // .then((phases) => _.flatten(_.map(phases, 'products')))
209+ // }
210210
211211/**
212212 * Create timeline and milestones for a product
@@ -235,11 +235,12 @@ function createTimelineAndMilestoneForProduct(product, phase) {
235235 * @returns {Promise } project
236236 */
237237function createProductsTimelineAndMilestone ( project ) {
238- return getAllProjectProducts ( project )
239- . then ( ( products ) =>
240- Promise . all ( products . map ( createTimelineAndMilestoneForProduct ) )
241- )
242- . then ( ( ) => project )
238+ if ( project . phases ) {
239+ const products = _ . flatten ( _ . map ( project . phases , 'products' ) )
240+ return Promise . all ( products . map ( createTimelineAndMilestoneForProduct ) ) . then ( ( ) => project )
241+ } else {
242+ console . log ( 'We did not receive the phases for the project. Hence timeline and milestones are not created' )
243+ }
243244}
244245
245246export function createProduct ( project , productTemplate , phases , timelines ) {
You can’t perform that action at this time.
0 commit comments