Feat: Datos de contacto customer #46

This commit is contained in:
sinergia 2024-11-02 12:18:39 -05:00
parent ffa1622870
commit 2ed8b5b3a5
2 changed files with 4 additions and 2 deletions

View File

@ -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: ''
}; };

View File

@ -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']