import qs from 'qs' import type { ApiClient } from '../../core/ApiClient' import { BaseCrudApi } from '../../core/BaseCrudApi' import type { ListQuery, Paginated } from '../../core/types' import type { Term, CreateTermPayload, UpdateTermPayload } from './types' export class TermsApi extends BaseCrudApi { constructor(client: ApiClient) { super(client, '/terms') } /** Returns all terms where agreementDate is null for the current user's account (i.e. terms not yet agreed to). */ getNotAgreed( query?: ListQuery, headers?: Record, ): Promise> { const queryString = query ? `?${qs.stringify(query)}` : '' return this.client.get>( `${this.basePath}/terms-not-agreed${queryString}`, headers, ) } }