File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export class CenterComponent implements OnInit {
59
59
}
60
60
61
61
onPublishQuestionnaire ( ) {
62
- this . questionnaireService . publishQuestionnaire ( this . selectedQuestionnaire . id )
62
+ this . questionnaireService . updateQuestionnaireState ( this . selectedQuestionnaire . id , QuestionnaireState . Published )
63
63
. subscribe (
64
64
questionnaire => {
65
65
this . selectedQuestionnaire . state = QuestionnaireState . Published ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
2
2
import { Observable } from 'rxjs/Rx' ;
3
3
import { HttpClient , HttpHeaders } from '@angular/common/http' ;
4
4
5
- import { QuestionnaireModel } from '../../shared/models/questionnaire.model' ;
5
+ import { QuestionnaireModel , QuestionnaireState } from '../../shared/models/questionnaire.model' ;
6
6
import { SITE_HOST_URL } from '../../shared/index' ;
7
7
8
8
@Injectable ( )
@@ -54,9 +54,9 @@ export class QuestionnaireService {
54
54
}
55
55
56
56
//发布问卷
57
- publishQuestionnaire ( id : string ) {
57
+ updateQuestionnaireState ( id : string , state : QuestionnaireState ) {
58
58
return this . http
59
- . get ( SITE_HOST_URL + 'questionnaire/publish/' + id )
59
+ . post ( SITE_HOST_URL + 'questionnaire/updateState' , { id : id , state : state } )
60
60
. map ( ( res : any ) => < QuestionnaireModel > res . data )
61
61
. catch ( this . handleError ) ;
62
62
}
You can’t perform that action at this time.
0 commit comments