ultima correción de drive

This commit is contained in:
2022-11-22 19:46:02 -06:00
parent 74e3c265b0
commit afc29c4208
2 changed files with 4 additions and 5 deletions
+3 -5
View File
@@ -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.` };
});
};
+1
View File
@@ -179,4 +179,5 @@ module.exports = {
folder,
uploadFile,
deleteFile,
mkDir,
};