From bfc7fa2308a52477b137cd013eedf9af92c514b0 Mon Sep 17 00:00:00 2001 From: loischen68 Date: Fri, 4 Oct 2024 16:57:01 +0800 Subject: [PATCH 1/2] fix: adjust program and activity and podcastProgram filter locales --- src/hooks/podcast.ts | 6 ++++- .../ActivityCollectionPage.tsx | 5 +++- src/pages/PodcastProgramCollectionPage.tsx | 23 ++++++++++--------- .../ProgramCollectionPage.tsx | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/hooks/podcast.ts b/src/hooks/podcast.ts index 51eb6ff56..80261f9d6 100644 --- a/src/hooks/podcast.ts +++ b/src/hooks/podcast.ts @@ -18,7 +18,11 @@ export const usePodcastProgramCollection = (creatorId?: string) => { podcast_program( order_by: { published_at: desc } where: { - podcast_program_roles: { member_id: { _eq: $creatorId }, name: { _eq: "instructor" } } + podcast_program_roles: { + member_id: { _eq: $creatorId } + name: { _eq: "instructor" } + member: { app_id: { _eq: "demo" } } + } published_at: { _is_null: false } } ) { diff --git a/src/pages/ActivityCollectionPage/ActivityCollectionPage.tsx b/src/pages/ActivityCollectionPage/ActivityCollectionPage.tsx index 965416e82..da9bf1337 100644 --- a/src/pages/ActivityCollectionPage/ActivityCollectionPage.tsx +++ b/src/pages/ActivityCollectionPage/ActivityCollectionPage.tsx @@ -87,7 +87,10 @@ const ActivityCollectionPage = () => { const filteredActivities = activities .filter(activity => classification === null || activity.categories.some(category => category.id === classification)) - .filter(activity => !activity.supportLocales || activity.supportLocales.find(locale => locale === currentLocale)) + .filter( + activity => + activity?.supportLocales === null || activity?.supportLocales?.some(locale => locale === currentLocale), + ) return ( diff --git a/src/pages/PodcastProgramCollectionPage.tsx b/src/pages/PodcastProgramCollectionPage.tsx index f9bc091b1..de13bb1d2 100644 --- a/src/pages/PodcastProgramCollectionPage.tsx +++ b/src/pages/PodcastProgramCollectionPage.tsx @@ -34,6 +34,17 @@ const PodcastProgramCollectionPage: React.VFC = () => { uniqBy(category => category?.id, flatten(podcastPrograms.map(podcastProgram => podcastProgram.categories))), ) + const filteredPodcastPrograms = podcastPrograms + .filter( + podcastProgram => + !selectedCategoryId || podcastProgram.categories?.some(category => category.id === selectedCategoryId), + ) + .filter( + podcastProgram => + podcastProgram?.supportLocales === null || + podcastProgram?.supportLocales?.some(locale => locale === currentLocale), + ) + useEffect(() => { if (podcastPrograms) { podcastPrograms.forEach((podcastProgram, index) => { @@ -110,17 +121,7 @@ const PodcastProgramCollectionPage: React.VFC = () => {
- !selectedCategoryId || - podcastProgram.categories?.some(category => category.id === selectedCategoryId), - ) - .filter( - podcastProgram => - !podcastProgram.supportLocales || - podcastProgram.supportLocales.find(locale => locale === currentLocale), - )} + podcastPrograms={filteredPodcastPrograms} renderItem={({ podcastProgram, isEnrolled, isSubscribed }) => (
{ const filteredPrograms = programs.filter( program => (!selectedCategoryId || program.categories?.some(category => category.id === selectedCategoryId)) && - (!program.supportLocales || program.supportLocales.find(locale => locale === currentLocale)), + (program?.supportLocales?.some(locale => locale === currentLocale) || program.supportLocales === null), ) useEffect(() => { From 90ccf358fc5faa0f54c39b85059fe660a34377ff Mon Sep 17 00:00:00 2001 From: loischen68 Date: Tue, 8 Oct 2024 09:21:48 +0800 Subject: [PATCH 2/2] fix: adjust usePodcastProgramCollection appId --- src/hasura.d.ts | 329 ++++++++++++++++++++++++++++++++++++++++++- src/hooks/podcast.ts | 8 +- 2 files changed, 331 insertions(+), 6 deletions(-) diff --git a/src/hasura.d.ts b/src/hasura.d.ts index 8a5c2e7c2..681a12fd4 100644 --- a/src/hasura.d.ts +++ b/src/hasura.d.ts @@ -12582,6 +12582,7 @@ export type appointment_plan = { id: Scalars['uuid']; is_private: Scalars['Boolean']; meet_generation_method: Scalars['String']; + meeting_link_url?: Maybe; options?: Maybe; phone?: Maybe; price: Scalars['numeric']; @@ -12804,6 +12805,7 @@ export type appointment_plan_bool_exp = { id?: InputMaybe; is_private?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; options?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; @@ -12954,6 +12956,7 @@ export type appointment_plan_insert_input = { id?: InputMaybe; is_private?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; options?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; @@ -12986,6 +12989,7 @@ export type appointment_plan_max_fields = { duration?: Maybe; id?: Maybe; meet_generation_method?: Maybe; + meeting_link_url?: Maybe; phone?: Maybe; price?: Maybe; published_at?: Maybe; @@ -13015,6 +13019,7 @@ export type appointment_plan_max_order_by = { duration?: InputMaybe; id?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; published_at?: InputMaybe; @@ -13045,6 +13050,7 @@ export type appointment_plan_min_fields = { duration?: Maybe; id?: Maybe; meet_generation_method?: Maybe; + meeting_link_url?: Maybe; phone?: Maybe; price?: Maybe; published_at?: Maybe; @@ -13074,6 +13080,7 @@ export type appointment_plan_min_order_by = { duration?: InputMaybe; id?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; published_at?: InputMaybe; @@ -13129,6 +13136,7 @@ export type appointment_plan_order_by = { id?: InputMaybe; is_private?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; options?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; @@ -13178,6 +13186,8 @@ export enum appointment_plan_select_column { /** column name */ meet_generation_method = 'meet_generation_method', /** column name */ + meeting_link_url = 'meeting_link_url', + /** column name */ options = 'options', /** column name */ phone = 'phone', @@ -13229,6 +13239,7 @@ export type appointment_plan_set_input = { id?: InputMaybe; is_private?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; options?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; @@ -13344,6 +13355,7 @@ export type appointment_plan_stream_cursor_value_input = { id?: InputMaybe; is_private?: InputMaybe; meet_generation_method?: InputMaybe; + meeting_link_url?: InputMaybe; options?: InputMaybe; phone?: InputMaybe; price?: InputMaybe; @@ -13410,6 +13422,8 @@ export enum appointment_plan_update_column { /** column name */ meet_generation_method = 'meet_generation_method', /** column name */ + meeting_link_url = 'meeting_link_url', + /** column name */ options = 'options', /** column name */ phone = 'phone', @@ -24586,6 +24600,174 @@ export type cw_learned_statistic_variance_fields = { total_program_time?: Maybe; }; +/** columns and relationships of "cw.member_tracking_log" */ +export type cw_member_tracking_log = { + __typename?: 'cw_member_tracking_log'; + adgroup?: Maybe; + adname?: Maybe; + brand?: Maybe; + campaign?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + landing?: Maybe; + medium?: Maybe; + member_id?: Maybe; + referrer?: Maybe; + source?: Maybe; + source_platform?: Maybe; +}; + +/** aggregated selection of "cw.member_tracking_log" */ +export type cw_member_tracking_log_aggregate = { + __typename?: 'cw_member_tracking_log_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "cw.member_tracking_log" */ +export type cw_member_tracking_log_aggregate_fields = { + __typename?: 'cw_member_tracking_log_aggregate_fields'; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "cw.member_tracking_log" */ +export type cw_member_tracking_log_aggregate_fieldscountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "cw.member_tracking_log". All fields are combined with a logical 'AND'. */ +export type cw_member_tracking_log_bool_exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + adgroup?: InputMaybe; + adname?: InputMaybe; + brand?: InputMaybe; + campaign?: InputMaybe; + content?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + landing?: InputMaybe; + medium?: InputMaybe; + member_id?: InputMaybe; + referrer?: InputMaybe; + source?: InputMaybe; + source_platform?: InputMaybe; +}; + +/** aggregate max on columns */ +export type cw_member_tracking_log_max_fields = { + __typename?: 'cw_member_tracking_log_max_fields'; + adgroup?: Maybe; + adname?: Maybe; + brand?: Maybe; + campaign?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + landing?: Maybe; + medium?: Maybe; + member_id?: Maybe; + referrer?: Maybe; + source?: Maybe; + source_platform?: Maybe; +}; + +/** aggregate min on columns */ +export type cw_member_tracking_log_min_fields = { + __typename?: 'cw_member_tracking_log_min_fields'; + adgroup?: Maybe; + adname?: Maybe; + brand?: Maybe; + campaign?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + landing?: Maybe; + medium?: Maybe; + member_id?: Maybe; + referrer?: Maybe; + source?: Maybe; + source_platform?: Maybe; +}; + +/** Ordering options when selecting data from "cw.member_tracking_log". */ +export type cw_member_tracking_log_order_by = { + adgroup?: InputMaybe; + adname?: InputMaybe; + brand?: InputMaybe; + campaign?: InputMaybe; + content?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + landing?: InputMaybe; + medium?: InputMaybe; + member_id?: InputMaybe; + referrer?: InputMaybe; + source?: InputMaybe; + source_platform?: InputMaybe; +}; + +/** select columns of table "cw.member_tracking_log" */ +export enum cw_member_tracking_log_select_column { + /** column name */ + adgroup = 'adgroup', + /** column name */ + adname = 'adname', + /** column name */ + brand = 'brand', + /** column name */ + campaign = 'campaign', + /** column name */ + content = 'content', + /** column name */ + created_at = 'created_at', + /** column name */ + id = 'id', + /** column name */ + landing = 'landing', + /** column name */ + medium = 'medium', + /** column name */ + member_id = 'member_id', + /** column name */ + referrer = 'referrer', + /** column name */ + source = 'source', + /** column name */ + source_platform = 'source_platform' +} + +/** Streaming cursor of the table "cw_member_tracking_log" */ +export type cw_member_tracking_log_stream_cursor_input = { + /** Stream column input with initial value */ + initial_value: cw_member_tracking_log_stream_cursor_value_input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type cw_member_tracking_log_stream_cursor_value_input = { + adgroup?: InputMaybe; + adname?: InputMaybe; + brand?: InputMaybe; + campaign?: InputMaybe; + content?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + landing?: InputMaybe; + medium?: InputMaybe; + member_id?: InputMaybe; + referrer?: InputMaybe; + source?: InputMaybe; + source_platform?: InputMaybe; +}; + /** Boolean expression to compare columns of type "date". All fields are combined with logical 'AND'. */ export type date_comparison_exp = { _eq?: InputMaybe; @@ -45688,6 +45870,7 @@ export type member_tracking_log = { member_id: Scalars['String']; referrer?: Maybe; source?: Maybe; + source_platform?: Maybe; }; /** aggregated selection of "member_tracking_log" */ @@ -45755,6 +45938,7 @@ export type member_tracking_log_bool_exp = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** unique or primary key constraints on table "member_tracking_log" */ @@ -45778,6 +45962,7 @@ export type member_tracking_log_insert_input = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** aggregate max on columns */ @@ -45795,6 +45980,7 @@ export type member_tracking_log_max_fields = { member_id?: Maybe; referrer?: Maybe; source?: Maybe; + source_platform?: Maybe; }; /** order by max() on columns of table "member_tracking_log" */ @@ -45811,6 +45997,7 @@ export type member_tracking_log_max_order_by = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** aggregate min on columns */ @@ -45828,6 +46015,7 @@ export type member_tracking_log_min_fields = { member_id?: Maybe; referrer?: Maybe; source?: Maybe; + source_platform?: Maybe; }; /** order by min() on columns of table "member_tracking_log" */ @@ -45844,6 +46032,7 @@ export type member_tracking_log_min_order_by = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** response of any mutation on the table "member_tracking_log" */ @@ -45877,6 +46066,7 @@ export type member_tracking_log_order_by = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** primary key columns input for table: member_tracking_log */ @@ -45909,7 +46099,9 @@ export enum member_tracking_log_select_column { /** column name */ referrer = 'referrer', /** column name */ - source = 'source' + source = 'source', + /** column name */ + source_platform = 'source_platform' } /** input type for updating data in table "member_tracking_log" */ @@ -45926,6 +46118,7 @@ export type member_tracking_log_set_input = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** Streaming cursor of the table "member_tracking_log" */ @@ -45950,6 +46143,7 @@ export type member_tracking_log_stream_cursor_value_input = { member_id?: InputMaybe; referrer?: InputMaybe; source?: InputMaybe; + source_platform?: InputMaybe; }; /** update columns of table "member_tracking_log" */ @@ -45977,7 +46171,9 @@ export enum member_tracking_log_update_column { /** column name */ referrer = 'referrer', /** column name */ - source = 'source' + source = 'source', + /** column name */ + source_platform = 'source_platform' } export type member_tracking_log_updates = { @@ -50485,6 +50681,8 @@ export type mutation_root = { delete_role_permission?: Maybe; /** delete single row from the table: "role_permission" */ delete_role_permission_by_pk?: Maybe; + /** delete data from the table: "sales_lead_status_view" */ + delete_sales_lead_status_view?: Maybe; /** delete data from the table: "search_tag" */ delete_search_tag?: Maybe; /** delete single row from the table: "search_tag" */ @@ -51567,6 +51765,10 @@ export type mutation_root = { insert_role_permission?: Maybe; /** insert a single row into the table: "role_permission" */ insert_role_permission_one?: Maybe; + /** insert data into the table: "sales_lead_status_view" */ + insert_sales_lead_status_view?: Maybe; + /** insert a single row into the table: "sales_lead_status_view" */ + insert_sales_lead_status_view_one?: Maybe; /** insert data into the table: "search_tag" */ insert_search_tag?: Maybe; /** insert a single row into the table: "search_tag" */ @@ -53105,6 +53307,10 @@ export type mutation_root = { update_role_permission_by_pk?: Maybe; /** update multiples rows of table: "role_permission" */ update_role_permission_many?: Maybe>>; + /** update data of the table: "sales_lead_status_view" */ + update_sales_lead_status_view?: Maybe; + /** update multiples rows of table: "sales_lead_status_view" */ + update_sales_lead_status_view_many?: Maybe>>; /** update data of the table: "search_tag" */ update_search_tag?: Maybe; /** update single row of the table: "search_tag" */ @@ -56075,6 +56281,12 @@ export type mutation_rootdelete_role_permission_by_pkArgs = { }; +/** mutation root */ +export type mutation_rootdelete_sales_lead_status_viewArgs = { + where: sales_lead_status_view_bool_exp; +}; + + /** mutation root */ export type mutation_rootdelete_search_tagArgs = { where: search_tag_bool_exp; @@ -59767,6 +59979,18 @@ export type mutation_rootinsert_role_permission_oneArgs = { }; +/** mutation root */ +export type mutation_rootinsert_sales_lead_status_viewArgs = { + objects: Array; +}; + + +/** mutation root */ +export type mutation_rootinsert_sales_lead_status_view_oneArgs = { + object: sales_lead_status_view_insert_input; +}; + + /** mutation root */ export type mutation_rootinsert_search_tagArgs = { objects: Array; @@ -65820,6 +66044,19 @@ export type mutation_rootupdate_role_permission_manyArgs = { }; +/** mutation root */ +export type mutation_rootupdate_sales_lead_status_viewArgs = { + _set?: InputMaybe; + where: sales_lead_status_view_bool_exp; +}; + + +/** mutation root */ +export type mutation_rootupdate_sales_lead_status_view_manyArgs = { + updates: Array; +}; + + /** mutation root */ export type mutation_rootupdate_search_tagArgs = { _inc?: InputMaybe; @@ -109812,6 +110049,10 @@ export type query_root = { cw_learned_statistic: Array; /** fetch aggregated fields from the table: "cw.learned_statistic" */ cw_learned_statistic_aggregate: cw_learned_statistic_aggregate; + /** fetch data from the table: "cw.member_tracking_log" */ + cw_member_tracking_log: Array; + /** fetch aggregated fields from the table: "cw.member_tracking_log" */ + cw_member_tracking_log_aggregate: cw_member_tracking_log_aggregate; /** fetch data from the table: "email_template" */ email_template: Array; /** fetch aggregated fields from the table: "email_template" */ @@ -113113,6 +113354,24 @@ export type query_rootcw_learned_statistic_aggregateArgs = { }; +export type query_rootcw_member_tracking_logArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type query_rootcw_member_tracking_log_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type query_rootemail_templateArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -123382,6 +123641,14 @@ export type sales_lead_status_view_bool_exp = { status?: InputMaybe; }; +/** input type for inserting data into table "sales_lead_status_view" */ +export type sales_lead_status_view_insert_input = { + lead_status_category_id?: InputMaybe; + manager_id?: InputMaybe; + member_id?: InputMaybe; + status?: InputMaybe; +}; + /** aggregate max on columns */ export type sales_lead_status_view_max_fields = { __typename?: 'sales_lead_status_view_max_fields'; @@ -123400,6 +123667,15 @@ export type sales_lead_status_view_min_fields = { status?: Maybe; }; +/** response of any mutation on the table "sales_lead_status_view" */ +export type sales_lead_status_view_mutation_response = { + __typename?: 'sales_lead_status_view_mutation_response'; + /** number of rows affected by the mutation */ + affected_rows: Scalars['Int']; + /** data from the rows affected by the mutation */ + returning: Array; +}; + /** Ordering options when selecting data from "sales_lead_status_view". */ export type sales_lead_status_view_order_by = { lead_status_category_id?: InputMaybe; @@ -123420,6 +123696,14 @@ export enum sales_lead_status_view_select_column { status = 'status' } +/** input type for updating data in table "sales_lead_status_view" */ +export type sales_lead_status_view_set_input = { + lead_status_category_id?: InputMaybe; + manager_id?: InputMaybe; + member_id?: InputMaybe; + status?: InputMaybe; +}; + /** Streaming cursor of the table "sales_lead_status_view" */ export type sales_lead_status_view_stream_cursor_input = { /** Stream column input with initial value */ @@ -123436,6 +123720,13 @@ export type sales_lead_status_view_stream_cursor_value_input = { status?: InputMaybe; }; +export type sales_lead_status_view_updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: sales_lead_status_view_bool_exp; +}; + /** columns and relationships of "search_tag" */ export type search_tag = { __typename?: 'search_tag'; @@ -126433,6 +126724,12 @@ export type subscription_root = { cw_learned_statistic_aggregate: cw_learned_statistic_aggregate; /** fetch data from the table in a streaming manner: "cw.learned_statistic" */ cw_learned_statistic_stream: Array; + /** fetch data from the table: "cw.member_tracking_log" */ + cw_member_tracking_log: Array; + /** fetch aggregated fields from the table: "cw.member_tracking_log" */ + cw_member_tracking_log_aggregate: cw_member_tracking_log_aggregate; + /** fetch data from the table in a streaming manner: "cw.member_tracking_log" */ + cw_member_tracking_log_stream: Array; /** fetch data from the table: "email_template" */ email_template: Array; /** fetch aggregated fields from the table: "email_template" */ @@ -130871,6 +131168,31 @@ export type subscription_rootcw_learned_statistic_streamArgs = { }; +export type subscription_rootcw_member_tracking_logArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type subscription_rootcw_member_tracking_log_aggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type subscription_rootcw_member_tracking_log_streamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + export type subscription_rootemail_templateArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -154509,7 +154831,7 @@ export type GetAppointmentPlanVariables = Exact<{ }>; -export type GetAppointmentPlan = { __typename?: 'query_root', appointment_plan: Array<{ __typename?: 'appointment_plan', title: string, id: any }> }; +export type GetAppointmentPlan = { __typename?: 'query_root', appointment_plan: Array<{ __typename?: 'appointment_plan', title: string, id: any, creator_id?: string | null }> }; export type GetMerchandiseSpecVariables = Exact<{ id: Scalars['uuid']; @@ -154593,6 +154915,7 @@ export type GetProgramContentEbookHighlight = { __typename?: 'query_root', progr export type GET_PODCAST_PROGRAM_COLLECTIONVariables = Exact<{ creatorId?: InputMaybe; + appId?: InputMaybe; }>; diff --git a/src/hooks/podcast.ts b/src/hooks/podcast.ts index 80261f9d6..2e35b0446 100644 --- a/src/hooks/podcast.ts +++ b/src/hooks/podcast.ts @@ -9,19 +9,20 @@ import { StatusType } from '../types/general' import { PlaylistProps, PodcastProgramContent, PodcastProgramContentProps } from '../types/podcast' export const usePodcastProgramCollection = (creatorId?: string) => { + const { id: appId } = useApp() const { loading, error, data, refetch } = useQuery< hasura.GET_PODCAST_PROGRAM_COLLECTION, hasura.GET_PODCAST_PROGRAM_COLLECTIONVariables >( gql` - query GET_PODCAST_PROGRAM_COLLECTION($creatorId: String) { + query GET_PODCAST_PROGRAM_COLLECTION($creatorId: String, $appId: String) { podcast_program( order_by: { published_at: desc } where: { podcast_program_roles: { member_id: { _eq: $creatorId } name: { _eq: "instructor" } - member: { app_id: { _eq: "demo" } } + member: { app_id: { _eq: $appId } } } published_at: { _is_null: false } } @@ -60,7 +61,8 @@ export const usePodcastProgramCollection = (creatorId?: string) => { `, { variables: { - creatorId: creatorId, + creatorId, + appId, }, }, )