fix(user): return hospital data on user detail
This commit is contained in:
@ -14,7 +14,7 @@ import path from "path";
|
|||||||
import fileUpload from "express-fileupload";
|
import fileUpload from "express-fileupload";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import config from "../../config/stag.json";
|
import config from "../../config/stag.json";
|
||||||
import { IsNull } from "typeorm";
|
import { IsNull, Not } from "typeorm";
|
||||||
|
|
||||||
const log: Logger<ILogObj> = new Logger({
|
const log: Logger<ILogObj> = new Logger({
|
||||||
name: "[UserController]",
|
name: "[UserController]",
|
||||||
@ -1139,8 +1139,8 @@ export class UserController {
|
|||||||
// .where('utr.user_id = :id', { id: param.id })
|
// .where('utr.user_id = :id', { id: param.id })
|
||||||
// .getMany();
|
// .getMany();
|
||||||
|
|
||||||
// const repoHospital = OrmHelper.DB.getRepository(HospitalInformation);
|
const repoHospital = OrmHelper.DB.getRepository(HospitalInformation);
|
||||||
// const hospital = await repoHospital.findOne({});
|
const hospital = await repoHospital.findOne({ where: { id: Not(IsNull()) } });
|
||||||
|
|
||||||
if (detail != null) {
|
if (detail != null) {
|
||||||
const data = {
|
const data = {
|
||||||
@ -1149,7 +1149,7 @@ export class UserController {
|
|||||||
file_signature: detail.signature ? buildFileUrl(detail.signature) : null,
|
file_signature: detail.signature ? buildFileUrl(detail.signature) : null,
|
||||||
profile: detail.profile_picture ?? null,
|
profile: detail.profile_picture ?? null,
|
||||||
profile_picture: detail.profile_picture ? buildFileUrl(detail.profile_picture) : null,
|
profile_picture: detail.profile_picture ? buildFileUrl(detail.profile_picture) : null,
|
||||||
// hospital: hospital,
|
hospital: hospital,
|
||||||
};
|
};
|
||||||
|
|
||||||
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, data);
|
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, data);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
Munisipo,
|
Munisipo,
|
||||||
Administrativu,
|
Administrativu,
|
||||||
Nationality,
|
Nationality,
|
||||||
Application, //
|
Application,
|
||||||
Menu,
|
Menu,
|
||||||
User,
|
User,
|
||||||
UserActivity,
|
UserActivity,
|
||||||
@ -16,6 +16,11 @@ import {
|
|||||||
HrmsEmployee,
|
HrmsEmployee,
|
||||||
HrmsDepartment,
|
HrmsDepartment,
|
||||||
HrmsShift,
|
HrmsShift,
|
||||||
|
HospitalInformation,
|
||||||
|
Province,
|
||||||
|
City,
|
||||||
|
Subdistrict,
|
||||||
|
Ward,
|
||||||
} from "entity"
|
} from "entity"
|
||||||
import { ILogObj, Logger } from "tslog"
|
import { ILogObj, Logger } from "tslog"
|
||||||
|
|
||||||
@ -53,6 +58,11 @@ export class OrmHelper {
|
|||||||
HrmsPosition,
|
HrmsPosition,
|
||||||
HrmsShift,
|
HrmsShift,
|
||||||
HrmsEmployee,
|
HrmsEmployee,
|
||||||
|
HospitalInformation,
|
||||||
|
Province,
|
||||||
|
City,
|
||||||
|
Subdistrict,
|
||||||
|
Ward,
|
||||||
],
|
],
|
||||||
subscribers: [],
|
subscribers: [],
|
||||||
migrations: [],
|
migrations: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user