mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Can cancel the response to a survey
This commit is contained in:
		@@ -225,6 +225,8 @@ export const Routes : Route[] = [
 | 
				
			|||||||
	// Surveys controller
 | 
						// Surveys controller
 | 
				
			||||||
	{path: "/surveys/send_response", cb: (h) => SurveyController.SendResponse(h)},
 | 
						{path: "/surveys/send_response", cb: (h) => SurveyController.SendResponse(h)},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{path: "/surveys/cancel_response", cb: (h) => SurveyController.CancelResponse(h)},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Notifications controller
 | 
						// Notifications controller
 | 
				
			||||||
	{path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},
 | 
						{path: "/notifications/count_unread", cb: (h) => NotificationsController.CountUnread(h)},
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,6 +29,19 @@ export class SurveyController {
 | 
				
			|||||||
		h.success();
 | 
							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
 | 
						 * Turn a survey into an API entry
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user