Skip to content

Commit b8b6040

Browse files
committed
Fix issue with editing forms
1 parent f10e48a commit b8b6040

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Controllers/HomeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public IActionResult FormResponse(string formName, string id)
3030
public IActionResult EditForm(string formName, bool isAdmin = false)
3131
{
3232
string formTitle = DomainModelList.GetTitleByFormName(formName);
33-
return View(new EditFormModel() { FormTitle = formTitle, IsAdmin = isAdmin });
33+
return View(new EditFormModel() { FormName = formName, FormTitle = formTitle, IsAdmin = isAdmin });
3434
}
3535

3636
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

Models/EditFormModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace SurveyJSAsFormLibrary.Models
44
{
55
public class EditFormModel
66
{
7+
public string FormName { get; set; }
78
public string FormTitle { get; set; }
89
public bool IsAdmin { get; set; }
910
}

Views/Home/EditForm.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<div id="surveyCreatorContainer" style="height: 100vh;"></div>
1818
<script>
1919
const creator = new SurveyCreator.SurveyCreator(getCreatorOptions(false));
20-
setupCreator(creator, "@Model.FormTitle", "@Model.IsAdmin" === "True");
20+
setupCreator(creator, "@Model.FormName", "@Model.IsAdmin" === "True");
2121
creator.render("surveyCreatorContainer");
2222
</script>

0 commit comments

Comments
 (0)