Improving view

This commit is contained in:
Gregorio Chiko Putra
2019-05-15 16:16:21 +07:00
parent dbe517c1fc
commit 5839165531
18 changed files with 2895 additions and 120 deletions

View File

@@ -3,7 +3,7 @@ import m from "mithril"
var model = {
current: {},
fetch: src => {
m.request({
return m.request({
method: 'get',
url: '/api/access_log',
data: { src },
@@ -12,6 +12,16 @@ var model = {
model.current = response;
});
},
create: data => {
return m.request({
method: 'post',
url: '/api/access_log',
data,
})
.then(response => {
model.current = response;
});
},
}
export default model;

View File

@@ -1,4 +1,4 @@
import m from "mihtril"
import m from "mithril"
import AccessLog from "./AccessLog"
var model = {
@@ -8,12 +8,12 @@ var model = {
model.current = {};
m.request({
method: 'post',
url: '/api/hasil-belajar',
url: '/api/hasil_belajar',
data,
})
.then(response => {
model.current = response;
console.log(model.current);
AccessLog.fetch('sk-hasil-belajar');
})
.catch(e => {
model.error = JSON.parse(e.message);

View File

@@ -13,7 +13,7 @@ var model = {
})
.then(response => {
model.current = response;
AccessLog.fetch();
AccessLog.fetch('surat-kelulusan');
})
.catch(e => {
model.error = JSON.parse(e.message);