mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Can cancel the response to a survey
This commit is contained in:
parent
0e3bbd2125
commit
bf84f7814f
@ -225,6 +225,8 @@ export const Routes : Route[] = [
|
||||
// Surveys controller
|
||||
{path: "/surveys/send_response", cb: (h) => SurveyController.SendResponse(h)},
|
||||
|
||||
{path: "/surveys/cancel_response", cb: (h) => SurveyController.CancelResponse(h)},
|
||||
|
||||
|
||||
// Notifications controller
|
||||
{path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},
|
||||
|
@ -29,6 +29,19 @@ export class SurveyController {
|
||||
h.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the repsonse to a request
|
||||
*
|
||||
* @param h Request handler
|
||||
*/
|
||||
public static async CancelResponse(h: RequestHandler) {
|
||||
const surveyID = await this.PostSurveyIDFromPostID(h, "postID");
|
||||
|
||||
await SurveyHelper.CancelResponse(h.getUserId(), surveyID);
|
||||
|
||||
h.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Turn a survey into an API entry
|
||||
|
Loading…
Reference in New Issue
Block a user