Preparing new api for hasil-belajar

This commit is contained in:
Gregorio Chiko Putra
2019-05-14 15:26:44 +07:00
parent 9b91fe40ce
commit dbe517c1fc
6 changed files with 65 additions and 4 deletions

View File

@@ -2,10 +2,11 @@ import m from "mithril"
var model = {
current: {},
fetch: () => {
fetch: src => {
m.request({
method: 'get',
url: '/api/access_log',
data: { src },
})
.then(response => {
model.current = response;

24
resources/js/models/HasilBelajar.js vendored Normal file
View File

@@ -0,0 +1,24 @@
import m from "mihtril"
import AccessLog from "./AccessLog"
var model = {
current: {},
error: {},
cariData: data => {
model.current = {};
m.request({
method: 'post',
url: '/api/hasil-belajar',
data,
})
.then(response => {
model.current = response;
console.log(model.current);
})
.catch(e => {
model.error = JSON.parse(e.message);
});
},
};
export default model;