feat(user): return hospital data on user detail

This commit is contained in:
avicenan
2026-06-03 11:09:15 +09:00
parent d818244cfa
commit ebede4b0e7

View File

@ -1,5 +1,5 @@
import axios from "axios";
import { HrmsEmployee, Paging, User, UserRefreshToken, UserRole, UserToRoom } from "entity";
import { HospitalInformation, HrmsEmployee, Paging, User, UserRefreshToken, UserRole, UserToRoom } from "entity";
import exceljs from "exceljs";
import { NextFunction, Response } from "express";
import { Request } from "express-jwt";
@ -1139,6 +1139,9 @@ export class UserController {
// .where('utr.user_id = :id', { id: param.id })
// .getMany();
const repoHospital = OrmHelper.DB.getRepository(HospitalInformation);
const hospital = await repoHospital.findOne({});
if (detail != null) {
const data = {
...detail,
@ -1146,6 +1149,7 @@ export class UserController {
file_signature: detail.signature ? buildFileUrl(detail.signature) : null,
profile: detail.profile_picture ?? null,
profile_picture: detail.profile_picture ? buildFileUrl(detail.profile_picture) : null,
hospital: hospital,
};
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, data);