mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 16:45:17 +00:00
Users can cancel responses to a survey.
This commit is contained in:
@ -128,6 +128,22 @@ class Survey {
|
||||
return $results[0]["ID"];
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the response of a user to a survey
|
||||
*
|
||||
* @param int $surveyID The ID of the target survey
|
||||
* @param int $userID The ID of the user removing his response
|
||||
* @return bool FALSE in case of failure / TRUE in case of success
|
||||
*/
|
||||
public function cancel_response(int $surveyID, int $userID) : bool {
|
||||
|
||||
//Perform a request on the database
|
||||
return CS::get()->db->deleteEntry(
|
||||
$this::SURVEY_RESPONSE_TABLE,
|
||||
"ID_sondage = ? AND ID_utilisateurs = ?",
|
||||
array($surveyID, $userID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the survey associated to a post
|
||||
*
|
||||
|
Reference in New Issue
Block a user