Sha256: cdef56cdca82430fbb8ad6c49848621acb442d9d1e1843ae0609dd0660cc9081

Contents?: true

Size: 423 Bytes

Versions: 22

Compression:

Stored size: 423 Bytes

Contents

import axios from 'axios'
import applyCaseMiddleware from 'axios-case-converter'
import { validate as isUuid } from 'uuid'

const csrfToken = (document?.querySelector("meta[name=csrf-token]") as any)?.content
axios.defaults.headers.common['X-CSRF-Token'] = csrfToken

const restClient = applyCaseMiddleware(axios.create() as any, {
  preservedKeys: (key) => {
    return isUuid(key)
  }
}) as any

export default restClient

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
jason-rails-0.8.7 client/src/restClient.ts
jason-rails-0.8.6 client/src/restClient.ts
jason-rails-0.8.4 client/src/restClient.ts
jason-rails-0.8.3 client/src/restClient.ts
jason-rails-0.8.2 client/src/restClient.ts
jason-rails-0.8.1 client/src/restClient.ts
jason-rails-0.7.5.1 client/src/restClient.ts
jason-rails-0.8.0 client/src/restClient.ts
jason-rails-0.7.5 client/src/restClient.ts
jason-rails-0.7.3 client/src/restClient.ts
jason-rails-0.7.2 client/src/restClient.ts
jason-rails-0.7.1 client/src/restClient.ts
jason-rails-0.7.0 client/src/restClient.ts
jason-rails-0.6.8 client/src/restClient.ts
jason-rails-0.6.7 client/src/restClient.ts
jason-rails-0.6.6 client/src/restClient.ts
jason-rails-0.6.5 client/src/restClient.ts
jason-rails-0.6.4 client/src/restClient.ts
jason-rails-0.6.3 client/src/restClient.ts
jason-rails-0.6.2 client/src/restClient.ts