mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-26 07:57:17 +00:00
* eslint-setup: rules for frontend and server * setup pre-commit:hook * frontend:eslint fixes * frontend eslint errors and warning fixed * eslint:fix for ./server * fix server/test: expectatin string lint/error * pre-commit:updated * removed unwanted install cmd from docker file * recommended settings and extension for vscode * husky prepare script added * updated extension recommendations * added prettier as recommended extension * added pre-commit to package.json * remove .prettierrc file * resolve changes * resolve changes
33 lines
764 B
TypeScript
33 lines
764 B
TypeScript
export async function search(client, index: string, query: string): Promise<object> {
|
|
const result = await client.search({
|
|
index,
|
|
body: JSON.parse(query),
|
|
});
|
|
|
|
return result;
|
|
}
|
|
|
|
export async function indexDocument(client, index: string, body: string): Promise<object> {
|
|
const result = await client.index({
|
|
index,
|
|
body: JSON.parse(body),
|
|
});
|
|
|
|
return result;
|
|
}
|
|
|
|
export async function getDocument(client, index: string, id: string): Promise<object> {
|
|
const result = await client.get({ index, id });
|
|
|
|
return result;
|
|
}
|
|
|
|
export async function updateDocument(client, index: string, id: string, body: string): Promise<object> {
|
|
const result = await client.update({
|
|
index,
|
|
id,
|
|
body: JSON.parse(body),
|
|
});
|
|
|
|
return result;
|
|
}
|