Skip to content

Commit

Permalink
fix: 🐛 belongs_to_id
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaddeusJiang committed Oct 23, 2024
1 parent 4b0239c commit 8ae1923
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/save_it/bot.ex
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ defmodule SaveIt.Bot do
send_message(chat.id, "What do you want to search? animal, food, etc.")

_ ->
photos = TypesensePhoto.search_photos!(q)
photos = TypesensePhoto.search_photos!(q, belongs_to_id: chat.id)

answer_photos(chat.id, photos)
end
Expand Down
4 changes: 3 additions & 1 deletion lib/save_it/typesense_photo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ defmodule SaveIt.TypesensePhoto do
Typesense.get_document("photos", photo_id)
end

def search_photos!(q: q, belongs_to_id: belongs_to_id) do
def search_photos!(q, opts) do
belongs_to_id = Keyword.get(opts, :belongs_to_id)

req_body = %{
"searches" => [
%{
Expand Down

0 comments on commit 8ae1923

Please sign in to comment.