Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

Fix RSS Subscription form & move endpoint

Isaac Wisea1d02f110dbd
diff --git a/components/ModalContent/NewRssSubscriptionModal.tsx b/components/ModalContent/NewRssSubscriptionModal.tsx
index 90e8a280..c81b6a64 100644
--- a/components/ModalContent/NewRssSubscriptionModal.tsx
+++ b/components/ModalContent/NewRssSubscriptionModal.tsx
@@ -25,7 +25,7 @@ export default function NewRssSubscriptionModal({ onClose }: Props) {
const submit = async () => {
if (submitLoader) return;
- if (!form.name || !form.url || !form.collectionId) {
+ if (!form.name || !form.url || (!form.collectionId && !form.collectionName)) {
return toast.error(t("fill_all_fields"));
}
diff --git a/hooks/store/rss.tsx b/hooks/store/rss.tsx
index c420c1ce..9b71d036 100644
--- a/hooks/store/rss.tsx
+++ b/hooks/store/rss.tsx
@@ -14,7 +14,7 @@ const useRssSubscriptions = () => {
return useQuery({
queryKey: ["rss-subscriptions"],
queryFn: async () => {
- const response = await fetch("/api/v1/user/rss");
+ const response = await fetch("/api/v1/rss");
if (!response.ok) throw new Error("Failed to fetch rss subscriptions.");
const data = await response.json();
@@ -29,7 +29,7 @@ const useAddRssSubscription = () => {
return useMutation({
mutationFn: async (body: Partial<RssSubscription>) => {
- const response = await fetch("/api/v1/user/rss", {
+ const response = await fetch("/api/v1/rss", {
body: JSON.stringify(body),
method: "POST",
headers: {
@@ -53,7 +53,7 @@ const useDeleteRssSubscription = () => {
return useMutation({
mutationFn: async (rssSubscriptionId: number) => {
- const response = await fetch(`/api/v1/user/rss/${rssSubscriptionId}`, {
+ const response = await fetch(`/api/v1/rss/${rssSubscriptionId}`, {
method: "DELETE",
});
diff --git a/pages/api/v1/user/rss/[id].ts b/pages/api/v1/rss/[id].ts
similarity index 100%
rename from pages/api/v1/user/rss/[id].ts
rename to pages/api/v1/rss/[id].ts
diff --git a/pages/api/v1/user/rss/index.ts b/pages/api/v1/rss/index.ts
similarity index 100%
rename from pages/api/v1/user/rss/index.ts
rename to pages/api/v1/rss/index.ts