mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
22 lines
446 B
TypeScript
22 lines
446 B
TypeScript
"use server";
|
|
|
|
import { api } from "@homarr/api/server";
|
|
|
|
import type { WidgetProps } from "../definition";
|
|
|
|
export default async function getServerDataAsync({ itemId }: WidgetProps<"rssFeed">) {
|
|
if (!itemId) {
|
|
return {
|
|
initialData: undefined,
|
|
lastUpdatedAt: null,
|
|
};
|
|
}
|
|
const data = await api.widget.rssFeed.getFeeds({
|
|
itemId,
|
|
});
|
|
return {
|
|
initialData: data?.data,
|
|
lastUpdatedAt: data?.timestamp,
|
|
};
|
|
}
|