Skip to content

Commit

Permalink
Fix bug in JSON edit/delete buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
JaseMK committed May 17, 2022
1 parent 491cae1 commit 488b273
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions view/mkdf/stream/json-browser/details.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,6 @@
var sort = $("#sort").val();
var fields = enforceIdField($("#fields").val());

// FIXME - ensure '_id' field is not omitted from fields. If specifically omitted, add it back in, as it's used for edit/dete refs

var data = {
'query': query,
'pagesize': pagesize,
Expand Down Expand Up @@ -474,8 +472,8 @@
html += '<td><small><pre style="max-width: 580px;">' + prettyJson + '</pre></small></td>';
html += '<td>';
if (keyUsedPermission == 'a') {
html += '<a class="btn btn-sm btn-warning" href="/dataset/json/writedoc/10?docid='+docID+'&key='+keyUsed+'"><i class="fas fa-edit"></i> Edit</a><br />';
html += '<a class="btn btn-sm btn-danger" href="/dataset/json/deletedoc/10?docid='+docID+'&key='+keyUsed+'"><i class="fas fa-trash-alt"></i> Delete</a>';
html += '<a class="btn btn-sm btn-warning" href="/dataset/json/writedoc/<?= $dataset->id ?>?docid='+docID+'&key='+keyUsed+'"><i class="fas fa-edit"></i> Edit</a><br />';
html += '<a class="btn btn-sm btn-danger" href="/dataset/json/deletedoc/<?= $dataset->id ?>?docid='+docID+'&key='+keyUsed+'"><i class="fas fa-trash-alt"></i> Delete</a>';
}
else {
html += '<button type="button" class="btn btn-sm btn-warning" disabled><i class="fas fa-edit"></i> Edit</button><br />';
Expand Down

0 comments on commit 488b273

Please sign in to comment.