ultima correción de drive
This commit is contained in:
@@ -42,9 +42,7 @@ const nuevo = async (body, file) => {
|
||||
? validar.validarTexto(body.profesor, 'profesor', true, 50)
|
||||
: '';
|
||||
|
||||
return Usuario.findOne({
|
||||
where: { idUsuario },
|
||||
})
|
||||
return Usuario.findOne({ where: { idUsuario } })
|
||||
.then((res) => {
|
||||
if (!res) throw new Error('Este alumno no existe en la db.');
|
||||
if (res.idTipoUsuario !== 3)
|
||||
@@ -82,7 +80,7 @@ const nuevo = async (body, file) => {
|
||||
let carpeta = '';
|
||||
|
||||
drive
|
||||
.folder(numeroCuenta)
|
||||
.mkDir(numeroCuenta)
|
||||
.then((res) => {
|
||||
carpeta = res;
|
||||
return drive.uploadFile(
|
||||
@@ -97,7 +95,7 @@ const nuevo = async (body, file) => {
|
||||
{ carpeta, cartaAceptacion: res },
|
||||
{ where: { idServicio: servicio.idServicio } }
|
||||
)
|
||||
)
|
||||
);
|
||||
return { message: `Se Pre-Registro correctamente a este alumno.` };
|
||||
});
|
||||
};
|
||||
|
||||
@@ -179,4 +179,5 @@ module.exports = {
|
||||
folder,
|
||||
uploadFile,
|
||||
deleteFile,
|
||||
mkDir,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user