#186 reload after correction postage
This commit is contained in:
parent
ab3b7727c5
commit
5351fa0e4b
@ -155,13 +155,13 @@ namespace GanjooRazor.Areas.User.Pages
|
||||
{
|
||||
return new BadRequestObjectResult(await response.Content.ReadAsStringAsync());
|
||||
}
|
||||
return new OkObjectResult(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new BadRequestObjectResult("لطفا از گنجور خارج و مجددا به آن وارد شوید.");
|
||||
}
|
||||
}
|
||||
return new OkObjectResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +236,8 @@
|
||||
|
||||
},
|
||||
success: function () {
|
||||
alert('تصحیحات ارسال شد.')
|
||||
alert('تصحیحات ارسال شد.');
|
||||
location.reload(true);
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e)
|
||||
|
||||
@ -70,7 +70,7 @@ namespace RMuseum.Models.Ganjoor
|
||||
public RAppUser User { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// reviewed
|
||||
/// reviewed (this is now unnecessary due to Result field and can be removed)
|
||||
/// </summary>
|
||||
public bool Reviewed { get; set; }
|
||||
|
||||
|
||||
@ -4816,7 +4816,7 @@
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoemCorrection.Reviewed">
|
||||
<summary>
|
||||
reviewed
|
||||
reviewed (this is now unnecessary due to Result field and can be removed)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoemCorrection.ReviewDate">
|
||||
|
||||
@ -1305,12 +1305,6 @@ namespace RMuseum.Services.Implementation
|
||||
/// <returns></returns>
|
||||
public async Task<RServiceResult<GanjoorPoemCorrectionViewModel>> SuggestPoemCorrection(GanjoorPoemCorrectionViewModel correction)
|
||||
{
|
||||
//if the user has previously suggested corrections for this poem remove them and save this one as the last one
|
||||
//assuming that his/her corrections are included in this correction
|
||||
var existingsFromSameUser =
|
||||
await _context.GanjoorPoemCorrections
|
||||
.Where(c => c.PoemId == correction.PoemId && c.UserId == correction.UserId && c.Reviewed == false).ToArrayAsync();
|
||||
|
||||
var poem = (await GetPoemById(correction.PoemId, false, false, true, false, false, false, false, true, false)).Result;
|
||||
foreach (var verse in correction.VerseOrderText)
|
||||
{
|
||||
@ -1333,12 +1327,6 @@ namespace RMuseum.Services.Implementation
|
||||
await _context.SaveChangesAsync();
|
||||
correction.Id = dbCorrection.Id;
|
||||
|
||||
if (existingsFromSameUser.Length > 0)
|
||||
{
|
||||
_context.GanjoorPoemCorrections.RemoveRange(existingsFromSameUser);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
return new RServiceResult<GanjoorPoemCorrectionViewModel>(correction);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user