Fakultas Ilmu Komputer UI

Commit 254400cb authored by Usman Sidiq's avatar Usman Sidiq
Browse files

[WIP] Implementing delete in adminer database (TODO : Delete database from db sql)

parent 4f2278e4
......@@ -120,11 +120,14 @@ class AdminerDatabaseController extends Controller
/**
* Remove the specified resource from storage.
*
* @param \App\Models\AdminerDatabase $adminerDatabase
* @param $id
* @return \Illuminate\Http\Response
*/
public function destroy(AdminerDatabase $adminerDatabase)
public function destroy($id)
{
//
$database = AdminerDatabase::find($id);
$database->delete();
// @TODO delete db sql
}
}
......@@ -33,6 +33,7 @@
<tr>
<th>Database Name</th>
<th>Username Mahasiswa</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
......@@ -42,6 +43,9 @@
>
<td>{{ database.name }}</td>
<td>{{ database.user.user_id }}</td>
<td>
<button class="btn btn-danger btn-sm" @click="deleteData(database.id)">Delete</button>
</td>
</tr>
</tbody>
</table>
......@@ -84,6 +88,13 @@ export default {
db_name: this.db_name
})
.then(res => this.loadData());
},
deleteData(id) {
console.log(id);
axios.delete(this.admins_uri + '/' + id)
.then(res=> this.loadData());
let index = this.adminer_databases.indexOf(this.db_name);
this.adminer_databases.splice(index, 1);
}
},
mounted() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment