Feat: Actualizar listado de Clientes al crear uno nuevo
This commit is contained in:
		| @@ -82,6 +82,7 @@ | ||||
|                      if (response.ok) { | ||||
|                          const data = await response.json(); | ||||
|                          console.log('Cliente Guardado:', data); | ||||
|                          this.$emit('customerCreated'); | ||||
|                          this.closeModal(); | ||||
|                      } else { | ||||
|                          console.error('Error al Crear el Cliente:', response.statusText); | ||||
| @@ -98,7 +99,7 @@ | ||||
|                  phone: '' | ||||
|              }; | ||||
|              this.$refs.form.reset(); | ||||
|          } | ||||
|          }, | ||||
|      } | ||||
|  }; | ||||
| </script> | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|               class="mr-4" | ||||
|             ></v-autocomplete> | ||||
|             <v-btn color="primary" @click="openModal">Agregar Cliente</v-btn> | ||||
|             <CreateCustomerModal ref="customerModal" /> | ||||
|             <CreateCustomerModal ref="customerModal" @customerCreated="fetchClients"/> | ||||
|           </v-col> | ||||
|           <v-col | ||||
|             lg="2" | ||||
| @@ -256,6 +256,9 @@ | ||||
|        return new Intl.NumberFormat('es-ES', { style: 'currency', currency: 'COP' }).format(price); | ||||
|      }, | ||||
|    }, | ||||
|      mounted() { | ||||
|          this.fetchClients();  // Llama a fetchClients al montar el componente | ||||
|      } | ||||
|  }; | ||||
| </script> | ||||
| <style> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user