mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-07-11 04:22:48 +00:00
Return the choice of a user to a survey
This commit is contained in:
src
@ -1,5 +1,6 @@
|
||||
import { Survey, SurveyChoice } from "../entities/Survey";
|
||||
import { RequestHandler } from "../entities/RequestHandler";
|
||||
import { SurveyHelper } from "../helpers/SurveyHelper";
|
||||
|
||||
/**
|
||||
* Survey controller
|
||||
@ -29,6 +30,9 @@ export class SurveyController {
|
||||
|
||||
survey.choices.forEach((c) => data.choices[c.id.toString()] = this.SurveyChoiceToAPI(c))
|
||||
|
||||
if(h.signedIn)
|
||||
data.user_choice = await SurveyHelper.GetUserChoice(survey.id, h.getUserId());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user