Skip to content

Commit

Permalink
feat: add ChannelProductsInterface type and update getChannelProducts…
Browse files Browse the repository at this point in the history
… method to use it
  • Loading branch information
jaimetorresmctekk committed Jan 7, 2025
1 parent b1beb5b commit c5f8e04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/channels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

import { GET_CHANNEL_SOCIAL_CHANNELS } from '../../queries';
import { GET_CHANNEL_PRODUCTS } from '../../queries';
import { ChannelProductsInterface } from 'types/channel-products';

export class Channels {
constructor(protected client: ClientType) {}
Expand All @@ -32,7 +33,7 @@ export class Channels {
return response.data.socialChannels.data as ChannelInterface[];
}

public async getChannelProducts(id: string): Promise<ChannelInterface[]> {
public async getChannelProducts(id: string): Promise<ChannelProductsInterface[]> {
const response = await this.client.query({
query: GET_CHANNEL_PRODUCTS,
variables: { id },
Expand Down
8 changes: 8 additions & 0 deletions src/types/channel-products.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { VariantInterface } from './inventory';

export type ChannelProductsInterface = {
id: string;
name: string;
description: string;
variants?: VariantInterface[];
};

0 comments on commit c5f8e04

Please sign in to comment.