Skip to content

Commit

Permalink
small edit to prevData to save previous form data on save-roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Meleeman01 committed May 20, 2019
1 parent e1a555a commit fc42284
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions laravel/resources/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ $(document).ready(function()

$('.save-roles').on('click', function()
{
prevData = [];
var user = $('.user-id').value();
var role = $('.user-role').value();
var csrf = $('.csrf-token').value();
Expand All @@ -82,6 +83,7 @@ $(document).ready(function()
if($(this).prop('checked'))
{
data.roles.push($(this).value());
prevData.push($(this).value());
}
});

Expand Down

0 comments on commit fc42284

Please sign in to comment.