Files
homarr/packages/widgets/src/app/serverData.ts
2024-05-18 12:25:33 +02:00

17 lines
335 B
TypeScript

"use server";
import { api } from "@homarr/api/server";
import type { WidgetProps } from "../definition";
export default async function getServerDataAsync({
options,
}: WidgetProps<"app">) {
try {
const app = await api.app.byId({ id: options.appId });
return { app };
} catch (error) {
return { app: null };
}
}