make edit row demo edit the correct row :|

fixes https://github.com/bigskysoftware/htmx/issues/934
This commit is contained in:
Carson Gross 2022-06-02 10:19:39 -06:00
parent 2872b7dbc4
commit d997834842

View File

@ -142,7 +142,7 @@ this makes things a bit nicer to deal with.
});
onPut(/\/contact\/\d+/, function(request, params){
var id = parseInt("/contact/0/edit".split("/")[2]); // get the contact
var id = parseInt(request.url.split("/")[2]); // get the contact
contact = contacts[id]
contact.name = params['name'];
contact.email = params['email'];