Fakultas Ilmu Komputer UI

Commit 3d5ea5c6 authored by aabccd021's avatar aabccd021
Browse files

fix mahasiswa vue

parent 9c7d782a
......@@ -58,6 +58,8 @@ class MahasiswaController extends Controller
$mahasiswa->password = generateRandomString();
$mahasiswa->save();
// @TODO: create psql account
}
/**
......
......@@ -2131,6 +2131,7 @@ __webpack_require__.r(__webpack_exports__);
var _this = this;
 
axios.get(this.mahasiswas_uri).then(function (response) {
console.log(response);
$.when(_this.putAsyncData(response.data)).then(function () {
$("#datatable").DataTable();
});
......@@ -2138,6 +2139,8 @@ __webpack_require__.r(__webpack_exports__);
},
putAsyncData: function putAsyncData(data) {
this.mahasiswas = data;
console.log("mahasiswa:");
console.log(this.mahasiswas);
},
submitForm: function submitForm(e) {
e.preventDefault();
......@@ -20089,13 +20092,13 @@ var render = function() {
_vm._v(" "),
_c(
"tbody",
_vm._l(_vm.admins, function(admin) {
return _c("tr", { key: admin.id }, [
_c("td", [_vm._v(_vm._s(admin.id))]),
_vm._l(_vm.mahasiswas, function(mahasiswa) {
return _c("tr", { key: mahasiswa.id }, [
_c("td", [_vm._v(_vm._s(mahasiswa.id))]),
_vm._v(" "),
_c("td", [_vm._v(_vm._s(admin.user_id))]),
_c("td", [_vm._v(_vm._s(mahasiswa.user_id))]),
_vm._v(" "),
_c("td", [_vm._v(_vm._s(admin.password))]),
_c("td", [_vm._v(_vm._s(mahasiswa.password))]),
_vm._v(" "),
_c("td", [_vm._v("Love you")])
])
......
......@@ -19,10 +19,10 @@
</tr>
</thead>
<tbody>
<tr v-for="admin in admins" :key="admin.id">
<td>{{ admin.id }}</td>
<td>{{ admin.user_id }}</td>
<td>{{ admin.password }}</td>
<tr v-for="mahasiswa in mahasiswas" :key="mahasiswa.id">
<td>{{ mahasiswa.id }}</td>
<td>{{ mahasiswa.user_id }}</td>
<td>{{ mahasiswa.password }}</td>
<td>Love you</td>
</tr>
</tbody>
......@@ -51,6 +51,7 @@ export default {
methods: {
loadData() {
axios.get(this.mahasiswas_uri).then((response) => {
console.log(response);
$.when(this.putAsyncData(response.data)).then(function () {
$("#datatable").DataTable();
});
......@@ -58,6 +59,8 @@ export default {
},
putAsyncData(data) {
this.mahasiswas = data;
console.log("mahasiswa:");
console.log(this.mahasiswas);
},
submitForm(e) {
e.preventDefault();
......
Markdown is supported
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