fix(master-land): delete action for admin only

This commit is contained in:
arieeefajar 2025-05-26 19:26:42 +07:00
parent 8c36103ade
commit 37e50bc841
1 changed files with 8 additions and 6 deletions

View File

@ -78,12 +78,14 @@ class="fw-medium link-primary">#VZ2101</a></td>
<a href="{{ Auth::user()->role == 'admin' ? route('master_data.lahan.edit', $land->id) : route('lahan.edit', $land->id) }}"
class="btn btn-sm btn-warning edit-item-btn">Edit</a>
</div>
<div class="remove">
<button class="btn btn-sm btn-danger remove-item-btn"
data-bs-toggle="modal"
data-bs-target="#deleteRecordModal"
onclick="deleteData({{ json_encode(['landId' => $land->id, 'role' => Auth::user()->role]) }})">Hapus</button>
</div>
@if (Auth::user()->role == 'admin')
<div class="remove">
<button class="btn btn-sm btn-danger remove-item-btn"
data-bs-toggle="modal"
data-bs-target="#deleteRecordModal"
onclick="deleteData({{ json_encode(['landId' => $land->id, 'role' => Auth::user()->role]) }})">Hapus</button>
</div>
@endif
</div>
</td>
</tr>