change routes to update and create lib
This commit is contained in:
@@ -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',
|
||||
'',
|
||||
|
||||
Reference in New Issue
Block a user