안형욱

refact: es search 결과 형식 변경

import axios from 'axios';
const esInstance = axios.create({
baseURL: process.env.API_ENDPOINT,
baseURL: process.env.REACT_APP_API_ENDPOINT,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${process.env.SEARCH_KEY}`,
Authorization: `Bearer ${process.env.REACT_APP_SEARCH_KEY}`,
},
});
export const search = async searchWord => {
export const esApi = {
search: async searchWord => {
const res = await esInstance.post(
`/api/as/v1/engines/${process.env.APP_SEARCH_ENGINE_NAME}/search`,
`/api/as/v1/engines/${process.env.REACT_APP_ENGINE_NAME}/search`,
{
query: searchWord,
}
);
console.log(res);
return res;
return res.data;
},
};
......