change routes to update and create lib

This commit is contained in:
2021-01-11 03:19:47 -06:00
parent 30d93847a5
commit 2e8938f863
16 changed files with 176 additions and 148 deletions
+4 -6
View File
@@ -1,6 +1,6 @@
<template>
<b-modal size="lg" id="modalEditarLibro" hide-footer title="Editar Libro">
<b-container fluid>
<b-container fluid v-if="libro!=null">
<b-row class="mb-2">
<b-col >
<h2 style="text-align:left;"> {{libro.titulo}}</h2>
@@ -183,9 +183,8 @@
</b-col>
<b-col cols="6">
<b-form-file
placeholder="Seleccione la imagen o arrastre..."
accept=".png"
accept=".png, .jpg"
id="imagen"
></b-form-file>
</b-col>
@@ -198,7 +197,6 @@
</b-col>
<b-col cols="6">
<b-form-file
placeholder="Seleccione el PDF o arrastre..."
id="pdf"
accept=".pdf"
@@ -225,7 +223,6 @@ import Swal from 'sweetalert2'
export default {
props: {
libro: Object,
value: String
},
data() {
return {
@@ -279,7 +276,8 @@ export default {
if(this.isActiveDescripcion) formData.append("descripcion", this.descripcion);
if(this.isActiveYear) formData.append("year", this.year);
formData.append("idLibro", idLibro);
await axios.post( `${config.api}/actualizarLibro`, formData ,{ headers: { 'Content-Type': 'multipart/form-data' } });
formData.append("type", 'editarLibro');
await axios.post( `${config.api}/actualizarLibro`, formData ,{ headers: { 'Content-Type': 'multipart/form-data' } });
await Swal.fire(
'Libro actualizado con exito',
'',