forked from MDCPS/DamageAssessment_Backend
		
	multiple questions updated based on survey id
This commit is contained in:
		| @ -1,5 +1,6 @@ | ||||
| using DamageAssesment.Api.Questions.Interfaces; | ||||
| using Microsoft.AspNetCore.Authorization; | ||||
| using DamageAssesment.Api.Questions.Models; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
|  | ||||
| namespace DamageAssesment.Api.Questions.Controllers | ||||
| @ -111,6 +112,26 @@ namespace DamageAssesment.Api.Questions.Controllers | ||||
|             return CreatedAtRoute("DefaultApi",questions); | ||||
|         } | ||||
|         /// <summary> | ||||
|         /// PUT request for update a multiple question (multilingual) for survey. | ||||
|         /// </summary> | ||||
|         [HttpPut("questions/multiple/{surveyid}")] | ||||
|         public async Task<IActionResult> CreateQuestions(int surveyid, List<Models.Question> questions) | ||||
|         { | ||||
|             if (questions != null) | ||||
|             { | ||||
|                 var result = await this.questionsProvider.PutQuestionsAsync(surveyid,questions); | ||||
|                 if (result.IsSuccess) | ||||
|                 { | ||||
|                     return Ok(result.Question); | ||||
|                 } | ||||
|                 if (result.ErrorMessage == "Not Found") | ||||
|                     return NotFound(result.ErrorMessage); | ||||
|  | ||||
|                 return BadRequest(result.ErrorMessage); | ||||
|             } | ||||
|             return CreatedAtRoute("DefaultApi", questions); | ||||
|         } | ||||
|         /// <summary> | ||||
|         /// POST request for creating a new question (multilingual). | ||||
|         /// </summary> | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user