uodate
This commit is contained in:
@ -24,7 +24,7 @@ const hospitalCreateUpdateSchema = {
|
||||
name: Joi.string().required().label("Hospital Name"),
|
||||
address: Joi.string().required().label("Hospital Address"),
|
||||
phone: Joi.string().required().label("Hospital Phone"),
|
||||
logo: Joi.string().allow(null,"").label("Hospital Logo"),
|
||||
logo: Joi.string().allow(null, "").label("Hospital Logo"),
|
||||
};
|
||||
|
||||
interface FileUploadRequest extends Request {
|
||||
@ -140,7 +140,7 @@ export class HospitalInformationController {
|
||||
|
||||
if (!hospital) throw { message: "Hospital " + Language.lang.failed_not_found };
|
||||
|
||||
if(param.logo == "" || param.logo == null || param.logo == undefined) param.logo = hospital.logo;
|
||||
if (param.logo == "" || param.logo == null || param.logo == undefined) param.logo = hospital.logo;
|
||||
|
||||
let hospitalinformation = new HospitalInformation();
|
||||
hospitalinformation.id = param.id;
|
||||
@ -205,9 +205,15 @@ export class HospitalInformationController {
|
||||
const file = req.files.file as fileUpload.UploadedFile;
|
||||
|
||||
// Validate file size (max 1MB)
|
||||
const maxSize = 1024 * 1024; // 1MB
|
||||
const maxSize = 10 * 1024 * 1024; // 10MB
|
||||
if (file.size > maxSize) {
|
||||
return ReturnHelper.errorResponse(res, 400, 400, Language.lang.failed_insert, "File size exceeds 1MB limit");
|
||||
return ReturnHelper.errorResponse(
|
||||
res,
|
||||
400,
|
||||
400,
|
||||
Language.lang.failed_insert,
|
||||
"File size exceeds 10MB limit"
|
||||
);
|
||||
}
|
||||
|
||||
// Validate file type
|
||||
|
||||
@ -84,7 +84,7 @@ export class RegistrationFeeController {
|
||||
const data = new RegistrationFee();
|
||||
data.type = param.type;
|
||||
data.service = Array.isArray(param.service) ? param.service : [];
|
||||
data.created_by = req.auth.data.name;
|
||||
data.created_by = req.auth?.data.name;
|
||||
|
||||
await OrmHelper.DB.getRepository(RegistrationFee).save(data);
|
||||
|
||||
@ -132,7 +132,7 @@ export class RegistrationFeeController {
|
||||
|
||||
registrationfee.type = param.type;
|
||||
registrationfee.service = Array.isArray(param.service) ? param.service : [];
|
||||
registrationfee.updated_by = req.auth.data.name;
|
||||
registrationfee.updated_by = req.auth?.data.name;
|
||||
|
||||
await OrmHelper.DB.manager.save(registrationfee);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user