From 2fc4adfbb0abfc4a78c6471c0348205c0b4361dc Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 3 Apr 2023 15:41:46 +0900 Subject: [PATCH] Update useGetRssFeed to use ids --- src/widgets/rss/RssWidgetTile.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/rss/RssWidgetTile.tsx b/src/widgets/rss/RssWidgetTile.tsx index 7eba78e37..fb25026d0 100644 --- a/src/widgets/rss/RssWidgetTile.tsx +++ b/src/widgets/rss/RssWidgetTile.tsx @@ -1,3 +1,5 @@ +import { defineWidget } from '../helper'; +import { IWidget } from '../widgets'; import { ActionIcon, Badge, @@ -29,8 +31,6 @@ import dayjs from 'dayjs'; import { useTranslation } from 'next-i18next'; import Link from 'next/link'; import { useState } from 'react'; -import { defineWidget } from '../helper'; -import { IWidget } from '../widgets'; const definition = defineWidget({ id: 'rss', @@ -56,11 +56,11 @@ interface RssTileProps { widget: IRssWidget; } -const useGetRssFeed = (feedUrl: string) => +export const useGetRssFeed = (feedUrl: string, widgetId: string) => useQuery({ queryKey: ['rss-feed', feedUrl], queryFn: async () => { - const response = await fetch('/api/modules/rss'); + const response = await fetch(`/api/modules/rss?widgetId=${widgetId}`); return response.json(); }, });