fix populate

This commit is contained in:
Simon Larsen 2022-09-25 12:48:51 +01:00
parent 5d09be86e0
commit 8233e9d31c
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
5 changed files with 11 additions and 6 deletions

View File

@ -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);
}

View File

@ -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 {

View File

@ -157,7 +157,7 @@ const DayUptimeGraph: FunctionComponent<ComponentProps> = (
}
return (
<Tooltip text={toolTipText || '100% Operational'}>
<Tooltip key={dayNumber} text={toolTipText || '100% Operational'}>
<div
className="uptime-bar"
style={{ backgroundColor: color.toString() }}

View File

@ -10,7 +10,7 @@ export interface ComponentProps {
const Tooltip: FunctionComponent<ComponentProps> = (
props: ComponentProps
): ReactElement => {
return <Tippy content={<span>{props.text}</span>}>{props.children}</Tippy>;
return <Tippy key={Math.random()} content={<span>{props.text}</span>}>{props.children}</Tippy>;
};
export default Tooltip;

View File

@ -8,7 +8,9 @@ const root: any = ReactDOM.createRoot(
);
root.render(
<BrowserRouter>
<App />
</BrowserRouter>
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
);