Created registration form
This commit is contained in:
26
assets/js/models/Category.js
vendored
Normal file
26
assets/js/models/Category.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import m from "mithril"
|
||||
|
||||
const Category = {
|
||||
current: {},
|
||||
list: [],
|
||||
fetch: function(id) {
|
||||
m.request({
|
||||
url: "http://api.questionnaire.dev/v1/categories/" + id,
|
||||
method: "GET"
|
||||
})
|
||||
.then(function(res) {
|
||||
Category.current = res
|
||||
})
|
||||
},
|
||||
loadList: function() {
|
||||
m.request({
|
||||
url: "http://api.questionnaire.dev/v1/categories",
|
||||
method: "GET"
|
||||
})
|
||||
.then(function(res) {
|
||||
Category.list = res
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default Category
|
||||
13
assets/js/models/Respondent.js
vendored
13
assets/js/models/Respondent.js
vendored
@@ -14,6 +14,19 @@ const Respondent = {
|
||||
Respondent.current = res
|
||||
Respondent.loading = false
|
||||
})
|
||||
},
|
||||
fetchByEmail: function(email) {
|
||||
Respondent.loading = true
|
||||
m.request({
|
||||
url: "http://api.questionnaire.dev/v1/respondents",
|
||||
method: "POST",
|
||||
data: {email}
|
||||
})
|
||||
.then(function(res) {
|
||||
Respondent.current = res
|
||||
Respondent.loading = false
|
||||
console.log(Respondent.current, res);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user