From 8233e9d31cc2fc3dc5264fa53e99501f6e3fdd96 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Sun, 25 Sep 2022 12:48:51 +0100 Subject: [PATCH] fix populate --- CommonServer/API/BaseAPI.ts | 3 +++ CommonServer/Utils/ModelPermission.ts | 2 +- CommonUI/src/Components/Graphs/DayUptimeGraph.tsx | 2 +- CommonUI/src/Components/Tooltip/Toolip.tsx | 2 +- Dashboard/src/Index.tsx | 8 +++++--- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CommonServer/API/BaseAPI.ts b/CommonServer/API/BaseAPI.ts index 17723e9fc4..36a30e67ef 100644 --- a/CommonServer/API/BaseAPI.ts +++ b/CommonServer/API/BaseAPI.ts @@ -308,6 +308,9 @@ export default class BaseAPI< props: this.getDatabaseCommonInteractionProps(req), }); + console.log("ITEM"); + console.log(item); + return Response.sendEntityResponse(req, res, item, this.entityType); } diff --git a/CommonServer/Utils/ModelPermission.ts b/CommonServer/Utils/ModelPermission.ts index 360d96993b..6c16c215a6 100644 --- a/CommonServer/Utils/ModelPermission.ts +++ b/CommonServer/Utils/ModelPermission.ts @@ -461,7 +461,7 @@ export default class ModelPermission { } { for (const key in populate) { if (typeof populate[key] === Typeof.Object) { - (select as any)[key] = (populate as any)[key]; + (select as any)[key] = { ...(populate as any)[key], _id: true }; (populate as any)[key] = true; } else { diff --git a/CommonUI/src/Components/Graphs/DayUptimeGraph.tsx b/CommonUI/src/Components/Graphs/DayUptimeGraph.tsx index 2e3dd74fcf..f90bed7950 100644 --- a/CommonUI/src/Components/Graphs/DayUptimeGraph.tsx +++ b/CommonUI/src/Components/Graphs/DayUptimeGraph.tsx @@ -157,7 +157,7 @@ const DayUptimeGraph: FunctionComponent = ( } return ( - +
= ( props: ComponentProps ): ReactElement => { - return {props.text}}>{props.children}; + return {props.text}}>{props.children}; }; export default Tooltip; diff --git a/Dashboard/src/Index.tsx b/Dashboard/src/Index.tsx index 28f0975b15..9427382fe2 100644 --- a/Dashboard/src/Index.tsx +++ b/Dashboard/src/Index.tsx @@ -8,7 +8,9 @@ const root: any = ReactDOM.createRoot( ); root.render( - - - + + + + + );