Skip to content

Commit

Permalink
fix: Filter addon and BM integration based on given id
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol committed May 31, 2024
1 parent 4f48b3c commit 1b9dd31
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ gql`
}
}
query getAddOnsForNetsuiteItemsList($page: Int, $limit: Int, $searchTerm: String) {
query getAddOnsForNetsuiteItemsList(
$page: Int
$limit: Int
$searchTerm: String
# integrationId used in item list fragment
$integrationId: ID!
) {
addOns(page: $page, limit: $limit, searchTerm: $searchTerm) {
metadata {
currentPage
Expand All @@ -63,7 +69,13 @@ gql`
}
}
query getBillableMetricsForNetsuiteItemsList($page: Int, $limit: Int, $searchTerm: String) {
query getBillableMetricsForNetsuiteItemsList(
$page: Int
$limit: Int
$searchTerm: String
# integrationId used in item list fragment
$integrationId: ID!
) {
billableMetrics(page: $page, limit: $limit, searchTerm: $searchTerm) {
metadata {
currentPage
Expand Down Expand Up @@ -121,6 +133,7 @@ const NetsuiteIntegrationItemsList = ({ integrationId }: { integrationId: string
notifyOnNetworkStatusChange: true,
variables: {
limit: 20,
integrationId,
},
})

Expand All @@ -137,6 +150,7 @@ const NetsuiteIntegrationItemsList = ({ integrationId }: { integrationId: string
notifyOnNetworkStatusChange: true,
variables: {
limit: 20,
integrationId,
},
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gql`
id
name
code
integrationMappings {
integrationMappings(integrationId: $integrationId) {
id
externalId
externalAccountCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gql`
id
name
code
integrationMappings {
integrationMappings(integrationId: $integrationId) {
id
externalId
externalAccountCode
Expand Down
27 changes: 21 additions & 6 deletions src/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export type AddOn = {
updatedAt: Scalars['ISO8601DateTime']['output'];
};


export type AddOnIntegrationMappingsArgs = {
integrationId?: InputMaybe<Scalars['ID']['input']>;
};

export type AddOnCollection = {
__typename?: 'AddOnCollection';
collection: Array<AddOn>;
Expand Down Expand Up @@ -192,6 +197,12 @@ export type BillableMetric = {
weightedInterval?: Maybe<WeightedIntervalEnum>;
};


/** Base billable metric */
export type BillableMetricIntegrationMappingsArgs = {
integrationId?: InputMaybe<Scalars['ID']['input']>;
};

export type BillableMetricCollection = {
__typename?: 'BillableMetricCollection';
collection: Array<BillableMetric>;
Expand Down Expand Up @@ -5856,6 +5867,7 @@ export type GetAddOnsForNetsuiteItemsListQueryVariables = Exact<{
page?: InputMaybe<Scalars['Int']['input']>;
limit?: InputMaybe<Scalars['Int']['input']>;
searchTerm?: InputMaybe<Scalars['String']['input']>;
integrationId: Scalars['ID']['input'];
}>;


Expand All @@ -5865,6 +5877,7 @@ export type GetBillableMetricsForNetsuiteItemsListQueryVariables = Exact<{
page?: InputMaybe<Scalars['Int']['input']>;
limit?: InputMaybe<Scalars['Int']['input']>;
searchTerm?: InputMaybe<Scalars['String']['input']>;
integrationId: Scalars['ID']['input'];
}>;


Expand Down Expand Up @@ -7487,7 +7500,7 @@ export const NetsuiteIntegrationItemsListAddonsFragmentDoc = gql`
id
name
code
integrationMappings {
integrationMappings(integrationId: $integrationId) {
id
externalId
externalAccountCode
Expand All @@ -7501,7 +7514,7 @@ export const NetsuiteIntegrationItemsListBillableMetricsFragmentDoc = gql`
id
name
code
integrationMappings {
integrationMappings(integrationId: $integrationId) {
id
externalId
externalAccountCode
Expand Down Expand Up @@ -13098,7 +13111,7 @@ export type GetIntegrationCollectionMappingsLazyQueryHookResult = ReturnType<typ
export type GetIntegrationCollectionMappingsSuspenseQueryHookResult = ReturnType<typeof useGetIntegrationCollectionMappingsSuspenseQuery>;
export type GetIntegrationCollectionMappingsQueryResult = Apollo.QueryResult<GetIntegrationCollectionMappingsQuery, GetIntegrationCollectionMappingsQueryVariables>;
export const GetAddOnsForNetsuiteItemsListDocument = gql`
query getAddOnsForNetsuiteItemsList($page: Int, $limit: Int, $searchTerm: String) {
query getAddOnsForNetsuiteItemsList($page: Int, $limit: Int, $searchTerm: String, $integrationId: ID!) {
addOns(page: $page, limit: $limit, searchTerm: $searchTerm) {
metadata {
currentPage
Expand Down Expand Up @@ -13127,10 +13140,11 @@ export const GetAddOnsForNetsuiteItemsListDocument = gql`
* page: // value for 'page'
* limit: // value for 'limit'
* searchTerm: // value for 'searchTerm'
* integrationId: // value for 'integrationId'
* },
* });
*/
export function useGetAddOnsForNetsuiteItemsListQuery(baseOptions?: Apollo.QueryHookOptions<GetAddOnsForNetsuiteItemsListQuery, GetAddOnsForNetsuiteItemsListQueryVariables>) {
export function useGetAddOnsForNetsuiteItemsListQuery(baseOptions: Apollo.QueryHookOptions<GetAddOnsForNetsuiteItemsListQuery, GetAddOnsForNetsuiteItemsListQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetAddOnsForNetsuiteItemsListQuery, GetAddOnsForNetsuiteItemsListQueryVariables>(GetAddOnsForNetsuiteItemsListDocument, options);
}
Expand All @@ -13147,7 +13161,7 @@ export type GetAddOnsForNetsuiteItemsListLazyQueryHookResult = ReturnType<typeof
export type GetAddOnsForNetsuiteItemsListSuspenseQueryHookResult = ReturnType<typeof useGetAddOnsForNetsuiteItemsListSuspenseQuery>;
export type GetAddOnsForNetsuiteItemsListQueryResult = Apollo.QueryResult<GetAddOnsForNetsuiteItemsListQuery, GetAddOnsForNetsuiteItemsListQueryVariables>;
export const GetBillableMetricsForNetsuiteItemsListDocument = gql`
query getBillableMetricsForNetsuiteItemsList($page: Int, $limit: Int, $searchTerm: String) {
query getBillableMetricsForNetsuiteItemsList($page: Int, $limit: Int, $searchTerm: String, $integrationId: ID!) {
billableMetrics(page: $page, limit: $limit, searchTerm: $searchTerm) {
metadata {
currentPage
Expand Down Expand Up @@ -13176,10 +13190,11 @@ export const GetBillableMetricsForNetsuiteItemsListDocument = gql`
* page: // value for 'page'
* limit: // value for 'limit'
* searchTerm: // value for 'searchTerm'
* integrationId: // value for 'integrationId'
* },
* });
*/
export function useGetBillableMetricsForNetsuiteItemsListQuery(baseOptions?: Apollo.QueryHookOptions<GetBillableMetricsForNetsuiteItemsListQuery, GetBillableMetricsForNetsuiteItemsListQueryVariables>) {
export function useGetBillableMetricsForNetsuiteItemsListQuery(baseOptions: Apollo.QueryHookOptions<GetBillableMetricsForNetsuiteItemsListQuery, GetBillableMetricsForNetsuiteItemsListQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetBillableMetricsForNetsuiteItemsListQuery, GetBillableMetricsForNetsuiteItemsListQueryVariables>(GetBillableMetricsForNetsuiteItemsListDocument, options);
}
Expand Down

0 comments on commit 1b9dd31

Please sign in to comment.