docs: #351 retrieving user selected rhyme letters and sending it to the service

This commit is contained in:
Hamid Reza Mohammadi 2022-07-26 19:29:36 +04:30
parent f4728ea209
commit a116400f06
2 changed files with 14 additions and 7 deletions

View File

@ -52,7 +52,17 @@ else
return;
}
if (breakFromVIndices.length == 0 && $('#rhythm-old').text() == $('#rhythm-new').val()) {
var rhythm_new = $('#rhythm-new').val();
if (rhythm_new == $('#rhythm-old').text()) {
rhythm_new = null;
}
var rhyme_letters = $('#rhyme-letters').val();
if (rhyme_letters == $('#rhyme-letters-old').text()) {
rhyme_letters = null;
}
if (breakFromVIndices.length == 0 && rhythm_new == null && rhyme_letters == null) {
alert('شما هیچ تغییری در متن نداده‌اید!');
return;
}
@ -60,11 +70,6 @@ else
$('#savecorrections').hide();
$('#saving').text('در حال ذخیره ...');
var rhythm_new = $('#rhythm-new').val();
if (rhythm_new == $('#rhythm-old').text()) {
rhythm_new = null;
}
var url = '?handler=SendSectionCorrections';
@ -74,6 +79,7 @@ else
data: {
sectionId: id,
rhythm: rhythm_new,
rhyme: rhyme_letters,
breakFromVIndices: breakFromVIndices,
note: $('#note').val()

View File

@ -165,7 +165,7 @@ namespace GanjooRazor.Areas.User.Pages
return Page();
}
public async Task<IActionResult> OnPostSendSectionCorrectionsAsync(int sectionId, string rhythm, int[] breakFromVIndices, string note)
public async Task<IActionResult> OnPostSendSectionCorrectionsAsync(int sectionId, string rhythm, string rhyme, int[] breakFromVIndices, string note)
{
using (HttpClient secureClient = new HttpClient())
{
@ -271,6 +271,7 @@ namespace GanjooRazor.Areas.User.Pages
{
SectionId = sectionId,
Rhythm = rhythm,
RhymeLetters = rhyme,
BreakFromVerse1VOrder = breakFromVerse1VOrder,
BreakFromVerse2VOrder = breakFromVerse2VOrder,
BreakFromVerse3VOrder = breakFromVerse3VOrder,