Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed May 25, 2021
1 parent 722e406 commit 9b75b47
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const createNewIndexAndPattern = async (indexName: string) => {
return await getHttp().fetch<CreateDocSourceResp>({
path: `/${INDEX_SOURCE_API_PATH}`,
method: 'POST',
body: convertObjectToBlob({
body: JSON.stringify({
index: indexName,
// Initially set to static mappings
mappings: {
Expand All @@ -25,7 +25,3 @@ export const createNewIndexAndPattern = async (indexName: string) => {
}),
});
};

const convertObjectToBlob = (obj: unknown) => {
return new Blob([JSON.stringify(obj)], { type: 'application/json' });
};

0 comments on commit 9b75b47

Please sign in to comment.