Remove fancy js features
This commit is contained in:
parent
b8f0f00bdf
commit
85e046f2dd
@ -14,19 +14,19 @@
|
||||
function getContact(id) {
|
||||
if(!id) return
|
||||
|
||||
$http.get(`/api/contacts/${id}`).then(resp => {
|
||||
$http.get("/api/contacts/"+id).then(function(resp) {
|
||||
vm.contact = resp.data;
|
||||
});
|
||||
};
|
||||
|
||||
function submitForm() {
|
||||
console.log(vm.contact);
|
||||
console.log("submitting contact", vm.contact);
|
||||
if(vm.contact._id) {
|
||||
$http.put(`/api/contacts/${vm.contact._id}`, vm.contact).then(resp => {
|
||||
$http.put("/api/contacts/"+vm.contact._id, vm.contact).then(function(resp){
|
||||
$location.path("/search");
|
||||
});
|
||||
} else {
|
||||
$http.post(`/api/contacts`, vm.contact).then(resp => {
|
||||
$http.post("/api/contacts", vm.contact).then(function(resp){
|
||||
$location.path("/search");
|
||||
});
|
||||
}
|
||||
|
@ -15,17 +15,18 @@
|
||||
|
||||
getContacts();
|
||||
function getContacts() {
|
||||
$http.get("/api/contacts").then(resp => {
|
||||
$http.get("/api/contacts").then(function(resp){
|
||||
vm.contacts = resp.data;
|
||||
}).catch(e => {
|
||||
}).catch(function(e) {
|
||||
console.error("Failed to get contacts", e);
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
function deleteContact(id) {
|
||||
modalService.confirm().then(resp => {
|
||||
$http.delete(`/api/contacts/${id}`).then(resp => {
|
||||
console.info(`Contact ${id}`)
|
||||
modalService.confirm().then(function(resp) {
|
||||
$http.delete("/api/contacts/"+id).then(function(resp) {
|
||||
console.log("Deleted contact "+id)
|
||||
getContacts();
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user