databse remote connection
This commit is contained in:
		@@ -1,12 +1,36 @@
 | 
			
		||||
$(document).ready(function() {
 | 
			
		||||
    //DELETE THIS
 | 
			
		||||
    $.ajax({
 | 
			
		||||
        type: "POST",
 | 
			
		||||
        url: "/shoppinglist",
 | 
			
		||||
        data: {
 | 
			
		||||
            name: "Name Test",
 | 
			
		||||
            description: "Description Test"
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    $("#iconadd").click(function(){
 | 
			
		||||
        $(".modal").modal();
 | 
			
		||||
        $("#addmodal").modal('open');
 | 
			
		||||
        // alert("sadcfghj");
 | 
			
		||||
    });
 | 
			
		||||
    // ---
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    $(".add").click(function(){
 | 
			
		||||
 | 
			
		||||
        let name = $("#einkaufslistenname").val();
 | 
			
		||||
        let beschreibung = $("#einkaufslistenbeschreibung").val();
 | 
			
		||||
 | 
			
		||||
        $.ajax({
 | 
			
		||||
            type: "POST",
 | 
			
		||||
            url: "/shoppinglist",
 | 
			
		||||
            data: {
 | 
			
		||||
                name: name,
 | 
			
		||||
                description: beschreibung
 | 
			
		||||
            },
 | 
			
		||||
            success(res){
 | 
			
		||||
                console.log("funktioniert");
 | 
			
		||||
            },
 | 
			
		||||
            error(err){ 
 | 
			
		||||
                console.log("error");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        });    
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
		Reference in New Issue
	
	Block a user