Updated views and api

This commit is contained in:
Gregorio Chiko Putra
2019-05-10 15:41:21 +07:00
parent 019ac42b65
commit 4bb4e7c56b
15 changed files with 2831 additions and 80 deletions

16
resources/js/models/AccessLog.js vendored Normal file
View File

@@ -0,0 +1,16 @@
import m from "mithril"
var model = {
current: {},
fetch: () => {
m.request({
method: 'get',
url: '/api/access_log',
})
.then(response => {
model.current = response;
});
},
}
export default model;

20
resources/js/models/Siswa.js vendored Normal file
View File

@@ -0,0 +1,20 @@
import m from "mithril"
import AccessLog from "./AccessLog"
var model = {
current: {},
cariData: data => {
m.request({
method: 'post',
url: '/api/siswa',
data
})
.then(response => {
model.current = response;
AccessLog.fetch();
console.log(model.current);
});
},
}
export default model;