mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-25 13:08:51 +00:00
Send new survey property
This commit is contained in:
parent
836f6783a0
commit
15b6315de8
@ -59,6 +59,7 @@ export class SurveyController {
|
||||
question: survey.question,
|
||||
user_choice: -1,
|
||||
choices: {},
|
||||
allowNewChoices: survey.allowNewChoices,
|
||||
}
|
||||
|
||||
survey.choices.forEach((c) => data.choices[c.id.toString()] = this.SurveyChoiceToAPI(c))
|
||||
|
@ -16,7 +16,8 @@ export interface SurveyBuilder {
|
||||
timeCreate: number;
|
||||
postID: number;
|
||||
question: string;
|
||||
choices: SurveyChoice[]
|
||||
choices: SurveyChoice[];
|
||||
allowNewChoices: boolean;
|
||||
}
|
||||
|
||||
export class Survey implements SurveyBuilder {
|
||||
@ -25,6 +26,7 @@ export class Survey implements SurveyBuilder {
|
||||
postID: number;
|
||||
question: string;
|
||||
choices: SurveyChoice[];
|
||||
allowNewChoices: boolean;
|
||||
|
||||
public constructor(info: SurveyBuilder) {
|
||||
for (const key in info) {
|
||||
|
@ -256,7 +256,8 @@ export class SurveyHelper {
|
||||
postID: row.ID_texte,
|
||||
timeCreate: new Date(row.date_creation).getTime()/1000,
|
||||
question: row.question,
|
||||
choices: []
|
||||
choices: [],
|
||||
allowNewChoices: row.allow_new_choices == 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user