stefbowerman/cadaver-2.0

Add KlaviyoAPI library + back in stock functionality

Closed this issue · 3 comments

Latest is on Bravest, build out for Howdy and then roll back into this repo

KlaviyoAPI class needs to accept a version argument

export default class KlaviyoAPI {
  constructor({ companyId, revision }) {
    this.companyId = companyId
    this.revision = revision || '2024-02-15'
  }

  ...

  makeRequest(urlBase, data) {
    const promise = $.Deferred()

    $.ajax({
      async: true,
      crossDomain: true,
      url: `${urlBase}?company_id=${this.companyId}`,
      method: 'POST',
      headers: {
        'revision': this.revision,
        'content-type': 'application/json',
        'cache-control': 'no-cache'
      },
      data: JSON.stringify(data)
    })

Closed with 2074367