@fluid-app/portal-sdk 0.1.232 → 0.1.233

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,6 +63,13 @@ const shareablesKeys = {
63
63
  },
64
64
  playlists: {
65
65
  all: ["playlists"],
66
+ list: (search, sort, ownership) => [
67
+ "playlists",
68
+ "list",
69
+ search,
70
+ sort,
71
+ ownership
72
+ ],
66
73
  detail: (id) => [
67
74
  "playlists",
68
75
  "detail",
@@ -9653,17 +9660,13 @@ function PlaylistsListingScreen(_props) {
9653
9660
  return () => clearTimeout(timer);
9654
9661
  }, [searchTerm]);
9655
9662
  const observerTarget = useRef(null);
9656
- const queryKey = [
9657
- ...shareablesKeys.playlists.all,
9658
- "list",
9659
- debouncedSearch,
9660
- sortValue
9661
- ];
9663
+ const queryKey = [...shareablesKeys.playlists.list(debouncedSearch, sortValue, ownerFilter)];
9662
9664
  const { data, isLoading, isFetchingNextPage, hasNextPage, fetchNextPage, error } = useInfiniteQuery({
9663
9665
  queryKey,
9664
9666
  queryFn: async ({ pageParam }) => {
9665
9667
  const response = await api.playlists.getPlaylists({
9666
9668
  "filter[title]": debouncedSearch || void 0,
9669
+ "filter[ownership]": ownerFilter !== "all" ? ownerFilter : void 0,
9667
9670
  "page[cursor]": pageParam,
9668
9671
  "page[limit]": PAGE_SIZE$2,
9669
9672
  sort: sortValue
@@ -9677,16 +9680,7 @@ function PlaylistsListingScreen(_props) {
9677
9680
  initialPageParam: void 0,
9678
9681
  placeholderData: keepPreviousData
9679
9682
  });
9680
- const allPlaylists = useMemo(() => data?.pages.flatMap((page) => page.playlists) ?? [], [data?.pages]);
9681
- const filteredPlaylists = useMemo(() => {
9682
- if (ownerFilter === "all" || !user?.id) return allPlaylists;
9683
- if (ownerFilter === "mine") return allPlaylists.filter((p) => p.user_id === user.id);
9684
- return allPlaylists.filter((p) => p.user_id !== user.id);
9685
- }, [
9686
- allPlaylists,
9687
- ownerFilter,
9688
- user?.id
9689
- ]);
9683
+ const filteredPlaylists = useMemo(() => data?.pages.flatMap((page) => page.playlists) ?? [], [data?.pages]);
9690
9684
  useEffect(() => {
9691
9685
  const target = observerTarget.current;
9692
9686
  if (!target) return;
@@ -12386,6 +12380,7 @@ function createRawPlaylistsAdapter(client) {
12386
12380
  "page[cursor]": params?.cursor,
12387
12381
  "page[limit]": params?.limit,
12388
12382
  "filter[title]": params?.["filter[title]"],
12383
+ "filter[ownership]": params?.["filter[ownership]"],
12389
12384
  sort: params?.sort
12390
12385
  });
12391
12386
  return {
@@ -12625,6 +12620,7 @@ function createPlaylistsAdapter(client) {
12625
12620
  cursor: options?.["page[cursor]"],
12626
12621
  limit: options?.["page[limit]"],
12627
12622
  "filter[title]": options?.["filter[title]"],
12623
+ "filter[ownership]": options?.["filter[ownership]"],
12628
12624
  sort: bffSort
12629
12625
  });
12630
12626
  return {
@@ -13461,4 +13457,4 @@ const shareablesScreenPropertySchema = {
13461
13457
  //#endregion
13462
13458
  export { ShareablesScreen_exports as n, shareablesScreenPropertySchema as r, ShareablesScreen as t };
13463
13459
 
13464
- //# sourceMappingURL=ShareablesScreen-DHKFnIOE.mjs.map
13460
+ //# sourceMappingURL=ShareablesScreen-DNjpEjLv.mjs.map