@@ -13,7 +13,7 @@ const host = 'http://localhost';
1313export const createClient = (
1414 port : number ,
1515 engine : EngineType ,
16- authorization = ''
16+ authorization = '' ,
1717) : EngineClient => {
1818 const headers = { 'Content-Type' : 'application/json' , authorization } ;
1919 const get = async < T > ( path : string ) : Promise < { status : number ; data : T } > => {
@@ -50,22 +50,22 @@ export const createClient = (
5050 debug ( `creating index: ${ name } ` ) ;
5151 const { status, data } = await put (
5252 engine === EngineType . ZINCSEARCH ? '/api/index' : `/${ name } ` ,
53- engine === EngineType . ZINCSEARCH ? { name, mappings } : body
53+ engine === EngineType . ZINCSEARCH ? { name, mappings } : body ,
5454 ) ;
5555 if ( status !== 200 ) {
5656 throw new Error (
57- `failed to create index: ${ name } , status: ${ status } , data: ${ JSON . stringify ( data ) } `
57+ `failed to create index: ${ name } , status: ${ status } , data: ${ JSON . stringify ( data ) } ` ,
5858 ) ;
5959 }
6060 } ;
6161 const deleteIndex = async ( { name } : IndexBody ) => {
6262 debug ( `deleting index: ${ name } ` ) ;
6363 const { status, data } = await del (
64- engine === EngineType . ZINCSEARCH ? `/api/index/${ name } ` : `/${ name } `
64+ engine === EngineType . ZINCSEARCH ? `/api/index/${ name } ` : `/${ name } ` ,
6565 ) ;
6666 if ( status !== 200 ) {
6767 throw new Error (
68- `failed to delete index: ${ name } , status: ${ status } , response: ${ JSON . stringify ( data ) } `
68+ `failed to delete index: ${ name } , status: ${ status } , response: ${ JSON . stringify ( data ) } ` ,
6969 ) ;
7070 }
7171 } ;
0 commit comments