Skip to content
Snippets Groups Projects
Verified Commit 62964825 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Camelize returned data.

parent bbad7a8e
No related branches found
No related tags found
2 merge requests!60New component to search senior (see #12). Enhance responsiveness and solve #10 and #11,!58Camelize data and insert react-hook-form in autocomplete.
import axios from 'axios'; import axios from 'axios';
import { camelizeKeys } from 'humps';
import { ResponseProps } from './ResponseProps'; import { ResponseProps } from './ResponseProps';
export const getSeniorList = async (name: string): Promise<ResponseProps[]> => export const getSeniorList = async (name: string): Promise<ResponseProps[]> =>
axios axios
.get(`/api/web/seniors/by_name/${name}?fields=user,id`) .get(`/api/web/seniors/by_name/${name}?fields=user,id`)
.then((res) => res.data); .then((res) => camelizeKeys(res.data) as ResponseProps[]);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment