How to use axios-case-converter - 1 common examples

To help you get started, we’ve selected a few axios-case-converter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mines-Paristech-Students / Portail-des-eleves / frontend / src / services / apiService.ts View on Github external
import { products } from "./api/products";
import { polls } from "./api/polls";
import { associations } from "./api/associations";
import { tags } from "./api/tags";
import { namespaces } from "./api/namespaces";
import { jwt } from "./api/jwt";
import { users } from "./api/users";
import { fundings } from "./api/fundings";
import { profile } from "./api/profile";
import { roles } from "./api/roles";
import { loanables } from "./api/library/loanables";
import { loans } from "./api/library/loans";

const baseApi = "http://localhost:8000/api/v1";

export const apiService = applyConverters(
  Axios.create({
    withCredentials: true,
    baseURL: baseApi,
  })
);

/**
 * Add a callback function to the promise, called on success, which returns the `data` of the `AxiosResponse`.
 */
export function unwrap(promise): Promise {
  return promise.then((response: AxiosResponse) => {
    return response.data;
  });
}

export const api = {

axios-case-converter

Axios transformer/interceptor that converts snake_case/camelCase

MIT
Latest version published 10 months ago

Package Health Score

61 / 100
Full package analysis

Popular axios-case-converter functions