Skip to content

Commit

Permalink
add res.send() func
Browse files Browse the repository at this point in the history
  • Loading branch information
afzal442 committed Oct 30, 2023
1 parent c2086e3 commit 72a281d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions ruby/sync_with_meilisearch/lib/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ def main(context)
'MEILISEARCH_SEARCH_API_KEY' => ENV['MEILISEARCH_SEARCH_API_KEY']
})

context.response.set_body(html)
context.response.set_status(200)
context.response.set_headers('Content-Type' => 'text/html; charset=utf-8')
return
return context.res.send(html, 200, { 'Content-Type' => 'text/html; charset=utf-8' })
end

client = Appwrite::Client.new
Expand Down Expand Up @@ -71,11 +68,5 @@ def main(context)

context.log('Sync finished.')

response = {
'message' => 'Sync finished.',
'status' => 'success'
}

context.response.set_body(response.to_json)
context.response.set_status(200)
return context.res.send('Sync finished.', 200)
end

0 comments on commit 72a281d

Please sign in to comment.