Feat: Datos de contacto customer #46
This commit is contained in:
		@@ -48,6 +48,7 @@
 | 
				
			|||||||
             valid: false,
 | 
					             valid: false,
 | 
				
			||||||
             customer: {
 | 
					             customer: {
 | 
				
			||||||
                 name: '',
 | 
					                 name: '',
 | 
				
			||||||
 | 
					                 address: '',
 | 
				
			||||||
                 email: '',
 | 
					                 email: '',
 | 
				
			||||||
                 phone: ''
 | 
					                 phone: ''
 | 
				
			||||||
             },
 | 
					             },
 | 
				
			||||||
@@ -69,9 +70,9 @@
 | 
				
			|||||||
             this.resetForm();
 | 
					             this.resetForm();
 | 
				
			||||||
         },
 | 
					         },
 | 
				
			||||||
         async submitForm() {
 | 
					         async submitForm() {
 | 
				
			||||||
 | 
					             console.log(this.customer)
 | 
				
			||||||
             if (this.$refs.form.validate()) {
 | 
					             if (this.$refs.form.validate()) {
 | 
				
			||||||
                 try {
 | 
					                 try {
 | 
				
			||||||
                     console.log(this.customer)
 | 
					 | 
				
			||||||
                     const response = await fetch('/don_confiao/api/customers/', {
 | 
					                     const response = await fetch('/don_confiao/api/customers/', {
 | 
				
			||||||
                         method: 'POST',
 | 
					                         method: 'POST',
 | 
				
			||||||
                         headers: {
 | 
					                         headers: {
 | 
				
			||||||
@@ -95,6 +96,7 @@
 | 
				
			|||||||
         resetForm() {
 | 
					         resetForm() {
 | 
				
			||||||
             this.customer = {
 | 
					             this.customer = {
 | 
				
			||||||
                 name: '',
 | 
					                 name: '',
 | 
				
			||||||
 | 
					                 address: '',
 | 
				
			||||||
                 email: '',
 | 
					                 email: '',
 | 
				
			||||||
                 phone: ''
 | 
					                 phone: ''
 | 
				
			||||||
             };
 | 
					             };
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,4 +23,4 @@ class ProductSerializer(serializers.ModelSerializer):
 | 
				
			|||||||
class CustomerSerializer(serializers.ModelSerializer):
 | 
					class CustomerSerializer(serializers.ModelSerializer):
 | 
				
			||||||
    class Meta:
 | 
					    class Meta:
 | 
				
			||||||
        model = Customer
 | 
					        model = Customer
 | 
				
			||||||
        fields = ['id', 'name', 'address']
 | 
					        fields = ['id', 'name', 'address', 'email', 'phone']
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user