Completed sync call for answer and attachment put and post methods

This commit is contained in:
uppuv
2023-08-25 07:20:37 -04:00
parent e56ffae1a4
commit cf3a04891b
6 changed files with 22 additions and 22 deletions

View File

@ -83,15 +83,15 @@ namespace DamageAssesment.Api.Attachments.Controllers
/// </summary>
[HttpPost("Attachments"), DisableRequestSizeLimit]
public async Task<IActionResult> UploadAttachmentAsync(AttachmentInfo attachmentInfo)
public IActionResult UploadAttachmentAsync(AttachmentInfo attachmentInfo)
{
try
{
if (attachmentInfo.Answers.Count > 0)
{
var Attachments = await this.AttachmentProvider.GetAttachmentCounter();
var Attachments = this.AttachmentProvider.GetAttachmentCounter();
List<Db.Attachment> attachments = UploadService.UploadAttachment(attachmentInfo.ResponseId, Attachments.counter, attachmentInfo.Answers);
var result = await this.AttachmentProvider.PostAttachmentAsync(attachments);
var result = this.AttachmentProvider.PostAttachmentAsync(attachments);
if (result.IsSuccess)
{
return Ok(result.Attachments);
@ -110,17 +110,17 @@ namespace DamageAssesment.Api.Attachments.Controllers
/// </summary>
[HttpPut("Attachments"), DisableRequestSizeLimit]
public async Task<IActionResult> UpdateAttachmentAsync(AttachmentInfo attachmentInfo)
public IActionResult UpdateAttachmentAsync(AttachmentInfo attachmentInfo)
{
try
{
if (attachmentInfo.Answers.Count > 0)
{
var res = await this.AttachmentProvider.GetAttachmentInfo(attachmentInfo.Answers);
var res = this.AttachmentProvider.GetAttachmentInfo(attachmentInfo.Answers);
if (res.IsSuccess)
{
List<Db.Attachment> attachments = UploadService.UpdateAttachments(attachmentInfo.ResponseId, attachmentInfo.Answers, res.Attachments);
var result = await this.AttachmentProvider.PutAttachmentAsync(attachments);
var result = this.AttachmentProvider.PutAttachmentAsync(attachments);
if (result.IsSuccess)
{
return Ok(result.Attachments);