login create and change version
This commit is contained in:
@@ -66,12 +66,10 @@
|
||||
</b-row>
|
||||
<b-row class="mb-2">
|
||||
<b-col>
|
||||
<b-form-input
|
||||
id="version"
|
||||
class="mb-2 mr-sm-2 mb-sm-0"
|
||||
placeholder="Versión"
|
||||
v-model="version"
|
||||
></b-form-input>
|
||||
<b-dropdown v-model="version" v-bind:text="version" block split split-variant="outline-primary" variant="primary" class="m-2">
|
||||
<b-dropdown-item @click="version='Impresa'" >Impresa</b-dropdown-item>
|
||||
<b-dropdown-item @click="version='Digital'" >Digital</b-dropdown-item>
|
||||
</b-dropdown>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<b-form-input
|
||||
@@ -150,7 +148,7 @@ export default {
|
||||
paginas:"",
|
||||
impresion:"",
|
||||
precio:"",
|
||||
version:"",
|
||||
version:"Versión",
|
||||
descripcion:"",
|
||||
year:"",
|
||||
|
||||
@@ -178,7 +176,7 @@ export default {
|
||||
if(this.paginas !== "") formData.append("paginas", this.paginas); else return this.faltaCampo("Paginas");
|
||||
if(this.impresion !== "") formData.append("edicion", this.impresion); else return this.faltaCampo("Edición");
|
||||
if(this.precio !== "") formData.append("precio", this.precio); else return this.faltaCampo("Precio");
|
||||
if(this.version !== "") formData.append("version", this.version); else return this.faltaCampo("Versión");
|
||||
if(this.version !== "Versión") formData.append("version", this.version); else return this.faltaCampo("Versión");
|
||||
if(this.descripcion !== "") formData.append("descripcion", this.descripcion); else return this.faltaCampo("Descripción");
|
||||
if(this.year !== "") formData.append("year", this.year); else return this.faltaCampo("Año de publicación");
|
||||
if(imagen.files.length > 0) formData.append("imagen", imagen.files[0]); else return this.faltaCampo("Imagen");
|
||||
@@ -186,7 +184,7 @@ export default {
|
||||
formData.append("type", 'addLibro');
|
||||
await axios.post( `${config.api}/actualizarLibro`, formData ,{ headers: { 'Content-Type': 'multipart/form-data' } });
|
||||
await Swal.fire(
|
||||
'Libro agregado con exito',
|
||||
'Libro agregado con éxito',
|
||||
'',
|
||||
'success'
|
||||
);
|
||||
@@ -196,7 +194,7 @@ export default {
|
||||
console.log(error);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'El libro no pudo ser agregada',
|
||||
title: 'El libro no pudo ser agregado',
|
||||
text: `Algo salio mal, ${error}`,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user