Merge pull request 'Feat: Datos de contacto customer #46' (#59) from DatosDeClienteAPI into main

Reviewed-on: OneTeam/don_confiao#59
This commit is contained in:
Rodia 2024-11-02 12:19:22 -05:00
commit 589b7c0bfb
2 changed files with 4 additions and 2 deletions

View File

@ -48,6 +48,7 @@
valid: false,
customer: {
name: '',
address: '',
email: '',
phone: ''
},
@ -69,9 +70,9 @@
this.resetForm();
},
async submitForm() {
console.log(this.customer)
if (this.$refs.form.validate()) {
try {
console.log(this.customer)
const response = await fetch('/don_confiao/api/customers/', {
method: 'POST',
headers: {
@ -95,6 +96,7 @@
resetForm() {
this.customer = {
name: '',
address: '',
email: '',
phone: ''
};

View File

@ -23,4 +23,4 @@ class ProductSerializer(serializers.ModelSerializer):
class CustomerSerializer(serializers.ModelSerializer):
class Meta:
model = Customer
fields = ['id', 'name', 'address']
fields = ['id', 'name', 'address', 'email', 'phone']