@@ -43,7 +43,6 @@ export class ProjectFormService {
4343 imageAddress : [ "" ] ,
4444 name : [ "" , [ Validators . required ] ] ,
4545 region : [ "" , [ Validators . required ] ] ,
46- step : [ null , [ Validators . required ] ] ,
4746 implementationDeadline : [ null ] ,
4847 trl : [ null ] ,
4948 links : this . fb . array ( [ ] ) ,
@@ -52,13 +51,13 @@ export class ProjectFormService {
5251 description : [ "" , [ Validators . required ] ] ,
5352 presentationAddress : [ "" , [ Validators . required ] ] ,
5453 coverImageAddress : [ "" , [ Validators . required ] ] ,
55- actuality : [ "" , [ Validators . max ( 1000 ) ] ] ,
56- targetAudience : [ "" , [ Validators . required , Validators . max ( 500 ) ] ] ,
57- problem : [ "" , [ Validators . required , Validators . max ( 1000 ) ] ] ,
54+ actuality : [ "" , [ Validators . maxLength ( 1000 ) ] ] ,
55+ targetAudience : [ "" , [ Validators . required , Validators . maxLength ( 500 ) ] ] ,
56+ problem : [ "" , [ Validators . required , Validators . maxLength ( 1000 ) ] ] ,
5857 partnerProgramId : [ null ] ,
5958 achievements : this . fb . array ( [ ] ) ,
6059 achievementsName : [ "" ] ,
61- achievementsPrize : [ "" ] ,
60+ achievementsDate : [ "" ] ,
6261 draft : [ null ] ,
6362 } ) ;
6463
@@ -99,7 +98,6 @@ export class ProjectFormService {
9998 imageAddress : project . imageAddress ,
10099 name : project . name ,
101100 region : project . region ,
102- step : project . step ,
103101 industryId : project . industry ,
104102 description : project . description ,
105103 implementationDeadline : project . implementationDeadline ?? null ,
@@ -146,17 +144,15 @@ export class ProjectFormService {
146144 private populateAchievementsFormArray ( achievements : any [ ] ) : void {
147145 const achievementsFormArray = this . projectForm . get ( "achievements" ) as FormArray ;
148146
149- // Очищаем существующие контролы
150147 while ( achievementsFormArray . length !== 0 ) {
151148 achievementsFormArray . removeAt ( 0 ) ;
152149 }
153150
154- // Добавляем новые контролы
155151 achievements . forEach ( ( achievement , index ) => {
156152 const achievementGroup = this . fb . group ( {
157153 id : achievement . id ?? index ,
158- title : achievement . title || "" ,
159- status : achievement . status || "" ,
154+ achievementsName : [ achievement . achievementsName || "" , Validators . required ] ,
155+ achievementsDate : [ achievement . achievementsDate || "" , Validators . required ] ,
160156 } ) ;
161157 achievementsFormArray . push ( achievementGroup ) ;
162158 } ) ;
@@ -207,10 +203,6 @@ export class ProjectFormService {
207203 return this . projectForm . get ( "industryId" ) ;
208204 }
209205
210- public get step ( ) {
211- return this . projectForm . get ( "step" ) ;
212- }
213-
214206 public get description ( ) {
215207 return this . projectForm . get ( "description" ) ;
216208 }
0 commit comments