si funciona no le muevas
This commit is contained in:
@@ -54,3 +54,5 @@ pids
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
imagenes
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { extname } from 'path';
|
||||
|
||||
export const renameImage = (req, file, callback) => {
|
||||
const profesorName = req.body.nombre.toLowerCase().replace(/ /g, '_');
|
||||
const fileExtName = extname(file.originalname);
|
||||
const fileName = `${profesorName}${fileExtName}`;
|
||||
callback(null, fileName);
|
||||
};
|
||||
|
||||
export const fileFilter = (req, file, callback) => {
|
||||
if (!file.originalname.match(/\.(jpg|jpeg|png)$/)) {
|
||||
return callback(new Error('Invalid format type'), false);
|
||||
}
|
||||
callback(null, true);
|
||||
};
|
||||
@@ -5,7 +5,7 @@ import { Profesor } from 'src/Profesor/entities/profesor.entity';
|
||||
@Entity({ name: 'usuario' })
|
||||
export class User {
|
||||
|
||||
@PrimaryGeneratedColumn({ name: 'PK_usuario' })
|
||||
@PrimaryGeneratedColumn()
|
||||
id_usuario: number;
|
||||
|
||||
@Column({ type: 'int', nullable: false })
|
||||
|
||||
Reference in New Issue
Block a user