diff --git a/src/query/contenttype-query.ts b/src/query/contenttype-query.ts index 523ad9a..7b3b1ac 100644 --- a/src/query/contenttype-query.ts +++ b/src/query/contenttype-query.ts @@ -1,12 +1,10 @@ -import { AxiosInstance, getData } from '@contentstack/core'; -import { FindResponse } from '../common/types'; +import { AxiosInstance } from '@contentstack/core'; +import { BaseQuery } from './base-query'; -export class ContentTypeQuery { - private _client: AxiosInstance; - private _urlPath: string; - _queryParams: { [key: string]: string | number } = {}; +export class ContentTypeQuery extends BaseQuery { constructor(client: AxiosInstance) { + super() this._client = client; this._urlPath = '/content_types'; } @@ -27,21 +25,4 @@ export class ContentTypeQuery { return this; } - /** - * @method find - * @memberof ContentTypeQuery - * @description Fetches all contentTypes of the stack - * @returns {Promise>} Promise that resolves to the find response containing content types - * @example - * import contentstack from '@contentstack/delivery-sdk' - * - * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" }); - * const contentTypeQuery = stack.contentType(); - * const result = await contentTypeQuery.find(); - */ - async find(): Promise> { - const response = await getData(this._client, this._urlPath, { params: this._queryParams }); - - return response as FindResponse; - } }