import type { AxiosInstance } from 'axios'; import type { ProductionRatingHalSchemaType } from '../../types'; import type { AsyncResult } from '../../utilities'; import { errorResult, successResult } from '../../utilities'; import type { ResourceQuery } from '../BaseResourceRepository'; import { BaseResourceRepository } from '../BaseResourceRepository'; export class ProductionRatingsResourceRepository extends BaseResourceRepository { constructor(axios: AxiosInstance, baseUrl: string) { super(axios, baseUrl); } public async getByProductionId( productionId: string, query?: ResourceQuery ): AsyncResult { try { const response = await this._axios.get( `${this._baseUrl}/by-production/${productionId}`, this.getRequestConfig(query) ); return successResult(response.data); } catch (error) { return errorResult(error as Error); } } }