aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/components/AddFeedForm.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/AddFeedForm.tsx')
-rw-r--r--frontend/src/components/AddFeedForm.tsx9
1 files changed, 3 insertions, 6 deletions
diff --git a/frontend/src/components/AddFeedForm.tsx b/frontend/src/components/AddFeedForm.tsx
index a60d86d..96afd39 100644
--- a/frontend/src/components/AddFeedForm.tsx
+++ b/frontend/src/components/AddFeedForm.tsx
@@ -1,13 +1,10 @@
import { faPlus, faSpinner } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useState } from "react";
+import { queryClient } from "../queryClient";
import { api } from "../services/api-client";
-interface Props {
- onFeedAdded?: () => void;
-}
-
-export function AddFeedForm({ onFeedAdded }: Props) {
+export function AddFeedForm() {
const [url, setUrl] = useState("");
const [error, setError] = useState<string | null>(null);
const [fetching, setFetching] = useState(false);
@@ -27,7 +24,7 @@ export function AddFeedForm({ onFeedAdded }: Props) {
setError(fetchError.message);
} else if (data) {
setUrl("");
- onFeedAdded?.();
+ queryClient.invalidateQueries({ queryKey: ["feeds"] });
}
} catch (error) {
setError(