1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-09-19 05:38:48 +00:00

Can create new Surveys

This commit is contained in:
2020-03-20 13:28:01 +01:00
parent 547d66e4dd
commit 167373c578
3 changed files with 80 additions and 0 deletions

26
src/entities/NewSurvey.ts Normal file
View File

@@ -0,0 +1,26 @@
/**
* New survey information handler
*
* @author Pierre HUBERT
*/
export interface NewSurveyBuilder {
postID?: number,
userID: number,
question: string,
choices: Array<string>
}
export class NewSurvey implements NewSurveyBuilder {
postID: number;
userID: number;
question: string;
choices: string[];
public constructor(info: NewSurveyBuilder) {
for (const key in info) {
if (info.hasOwnProperty(key))
this[key] = info[key];
}
}
}