import { BackendApiClient } from '../api-client';
export class BenefitsApi {
  async getBenefitsAsync() {
    return BackendApiClient.instance.url(`benefits`).get().json();
  }
  async postDocumentAsync(req) {
    return BackendApiClient.instance
      .url(`document`)
      .formData(req)
      .post()
      .badRequest(() => {
      throw new Error('Failed to upload document');
    })
      .json();
  }
  async postIconAsync(req) {
    return BackendApiClient.instance
      .url(`icon`)
      .formData(req)
      .post()
      .badRequest(() => {
      throw new Error('Failed to upload icon');
    })
      .json();
  }
  async getShopifyUrl() {
    return BackendApiClient.instance.url(`shopify-url`).get().json();
  }
}
export default new BenefitsApi();
