Skip to content

Commit

Permalink
Merge pull request #169 from Huilensolis/166-feature-revalidate-colle…
Browse files Browse the repository at this point in the history
…ctions-path-when-adding-a-post-to-a-collection

feature: add revalidate colelction list path when adding post to cole…
  • Loading branch information
huilensolis authored May 8, 2024
2 parents c3b80b2 + f1873a3 commit c55ecb2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use client";

import { revalidatePathOnEdge } from "@/actions/revalidate-path";
import { PlainButton } from "@/components/ui/buttons/plain";
import { Skeleton } from "@/components/ui/skeleton";
import { useSupabase } from "@/hooks/use-supabase";
import { ClientRouting } from "@/models/routing/client";
import { Database } from "@/supabase/types";
import { getShortName } from "@/utils/get-short-name";
import { useState } from "react";
Expand All @@ -29,6 +31,10 @@ export function CollectionItem({
.from("collection_item")
.insert({ post_id: postId, collection_id: collection.id });

await revalidatePathOnEdge(
ClientRouting.collection().list({ filter: "default" }),
"page",
);
setLoading(false);
}
return (
Expand Down

0 comments on commit c55ecb2

Please sign in to comment.