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:
26
src/entities/NewSurvey.ts
Normal file
26
src/entities/NewSurvey.ts
Normal 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];
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user