From b612d9dbf2e9fd1aea222d99abebc89fcd8cc343 Mon Sep 17 00:00:00 2001 From: Afzal Ansari Date: Fri, 27 Oct 2023 18:55:20 +0000 Subject: [PATCH] makes utils funcs used --- ruby/sync_with_meilisearch/lib/main.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ruby/sync_with_meilisearch/lib/main.rb b/ruby/sync_with_meilisearch/lib/main.rb index bbf6947c..ffb19147 100644 --- a/ruby/sync_with_meilisearch/lib/main.rb +++ b/ruby/sync_with_meilisearch/lib/main.rb @@ -1,7 +1,19 @@ require 'appwrite' require 'meilisearch' +require_relative 'utils' def main(context) + required_env_variables = [ + 'APPWRITE_API_KEY', + 'APPWRITE_DATABASE_ID', + 'APPWRITE_COLLECTION_ID', + 'MEILISEARCH_ENDPOINT', + 'MEILISEARCH_INDEX_NAME', + 'MEILISEARCH_ADMIN_API_KEY', + 'MEILISEARCH_SEARCH_API_KEY', + ] + + throw_if_missing(ENV, required_env_variables) client = Appwrite::Client.new client @@ -52,6 +64,7 @@ def main(context) } context.response.set_body(response.to_json) + context.response.set_status(200) return context.response end