@spree/storefront-api-v2-sdk
Version:
Node module to easily integrate your JavaScript or TypeScript application with Spree API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on
15 lines (12 loc) • 555 B
text/typescript
import Http from '../Http'
import { ICountriesResult, ICountryResult } from '../interfaces/Country'
import { IQuery } from '../interfaces/Query'
import { Routes } from '../routes'
export default class Countries extends Http {
public async list(): Promise<ICountriesResult> {
return await this.spreeResponse('get', Routes.countriesPath()) as ICountriesResult
}
public async show(iso: string, params: IQuery = {}): Promise<ICountryResult> {
return await this.spreeResponse('get', Routes.countryPath(iso), {}, params) as ICountryResult
}
}