From 91970a2fc66dba8c89ee6885cba51be9f1696d60 Mon Sep 17 00:00:00 2001 From: PrivateGER Date: Mon, 29 May 2023 20:09:52 +0200 Subject: [PATCH] formatter --- packages/backend/src/db/meilisearch.ts | 64 +++++++++++++------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/backend/src/db/meilisearch.ts b/packages/backend/src/db/meilisearch.ts index 60491f882..01efaa0ba 100644 --- a/packages/backend/src/db/meilisearch.ts +++ b/packages/backend/src/db/meilisearch.ts @@ -18,50 +18,50 @@ const hasConfig = config.meilisearch.port || config.meilisearch.apiKey); -if(hasConfig) { +if (hasConfig) { const host = hasConfig ? config.meilisearch.host ?? "localhost" : ""; - const port = hasConfig ? config.meilisearch.port ?? 7700 : 0; - const auth = hasConfig ? config.meilisearch.apiKey ?? "" : ""; - const ssl = hasConfig ? config.meilisearch.ssl ?? false : false; + const port = hasConfig ? config.meilisearch.port ?? 7700 : 0; + const auth = hasConfig ? config.meilisearch.apiKey ?? "" : ""; + const ssl = hasConfig ? config.meilisearch.ssl ?? false : false; - logger.info("Connecting to MeiliSearch"); + logger.info("Connecting to MeiliSearch"); client = new MeiliSearch({ host: `${ssl ? "https" : "http"}://${host}:${port}`, - apiKey: auth, - }); + apiKey: auth, + }); posts = client.index("posts"); posts - .updateSearchableAttributes(["text"]) - .catch((e) => - logger.error(`Setting searchable attr failed, searches won't work: ${e}`), - ); + .updateSearchableAttributes(["text"]) + .catch((e) => + logger.error(`Setting searchable attr failed, searches won't work: ${e}`), + ); - posts - .updateFilterableAttributes([ - "userName", - "userHost", - "mediaAttachment", - "createdAt", - "userId", - ]) - .catch((e) => - logger.error( - `Setting filterable attr failed, advanced searches won't work: ${e}`, - ), - ); + posts + .updateFilterableAttributes([ + "userName", + "userHost", + "mediaAttachment", + "createdAt", + "userId", + ]) + .catch((e) => + logger.error( + `Setting filterable attr failed, advanced searches won't work: ${e}`, + ), + ); - posts - .updateSortableAttributes(["createdAt"]) - .catch((e) => - logger.error( - `Setting sortable attr failed, placeholder searches won't sort properly: ${e}`, - ), - ); + posts + .updateSortableAttributes(["createdAt"]) + .catch((e) => + logger.error( + `Setting sortable attr failed, placeholder searches won't sort properly: ${e}`, + ), + ); - logger.info("Connected to MeiliSearch"); + logger.info("Connected to MeiliSearch"); } export type MeilisearchNote = {