Skip to content

Commit

Permalink
fix: fix lint issue
Browse files Browse the repository at this point in the history
Signed-off-by: seven <zilisheng1996@gmail.com>
  • Loading branch information
Blankll committed Mar 24, 2024
1 parent 3120c13 commit 21bae9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/engineClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const host = 'http://localhost';
export const createClient = (
port: number,
engine: EngineType,
authorization = ''
authorization = '',
): EngineClient => {
const headers = { 'Content-Type': 'application/json', authorization };
const get = async <T>(path: string): Promise<{ status: number; data: T }> => {
Expand Down Expand Up @@ -50,22 +50,22 @@ export const createClient = (
debug(`creating index: ${name}`);
const { status, data } = await put(
engine === EngineType.ZINCSEARCH ? '/api/index' : `/${name}`,
engine === EngineType.ZINCSEARCH ? { name, mappings } : body
engine === EngineType.ZINCSEARCH ? { name, mappings } : body,
);
if (status !== 200) {
throw new Error(
`failed to create index: ${name}, status: ${status}, data: ${JSON.stringify(data)}`
`failed to create index: ${name}, status: ${status}, data: ${JSON.stringify(data)}`,
);
}
};
const deleteIndex = async ({ name }: IndexBody) => {
debug(`deleting index: ${name}`);
const { status, data } = await del(
engine === EngineType.ZINCSEARCH ? `/api/index/${name}` : `/${name}`
engine === EngineType.ZINCSEARCH ? `/api/index/${name}` : `/${name}`,
);
if (status !== 200) {
throw new Error(
`failed to delete index: ${name}, status: ${status}, response: ${JSON.stringify(data)}`
`failed to delete index: ${name}, status: ${status}, response: ${JSON.stringify(data)}`,
);
}
};
Expand Down

0 comments on commit 21bae9b

Please sign in to comment.