Skip to content

Commit

Permalink
fix: adapt new record search URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominick Leppich committed Aug 20, 2024
1 parent a816ba1 commit a966cfb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions migration/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
VOCABULARY_LOOKUP_URL = 'http://{{HOST}}:{{PORT}}/api/v1/vocabularies/{{VOCABULARY_ID}}'

RECORD_INSERTION_URL = 'http://{{HOST}}:{{PORT}}/api/v1/vocabularies/{{VOCABULARY_ID}}/records'
RECORD_FIND_URL = 'http://{{HOST}}:{{PORT}}/api/v1/vocabularies/{{VOCABULARY_ID}}/records/search'
RECORD_FIND_URL = 'http://{{HOST}}:{{PORT}}/api/v1/vocabularies/{{VOCABULARY_ID}}/records?search={{SEARCH_TERM}}'
RECORD_LOOKUP_URL = 'http://{{HOST}}:{{PORT}}/api/v1/records/{{RECORD_ID}}'

TYPE_INSERTION_URL = 'http://{{HOST}}:{{PORT}}/api/v1/types'
Expand Down Expand Up @@ -107,8 +107,7 @@ def insert_record(self, record):
return result['id']

def find_record(self, ctx, vocabulary_id, search_term):
url = self.urls[RECORD_SEARCH].replace('{{VOCABULARY_ID}}', str(vocabulary_id))
url += f'?query={search_term}'
url = self.urls[RECORD_SEARCH].replace('{{VOCABULARY_ID}}', str(vocabulary_id)).replace('{{SEARCH_TERM}}', search_term)
result = self.query(url, obj=None, method='GET')
if not '_embedded' in result:
raise Exception(f'Record search for search term "{search_term}" has no results')
Expand Down

0 comments on commit a966cfb

Please sign in to comment.