fix api extract endpoint

This commit is contained in:
Richard 2023-12-25 07:51:45 +01:00
parent 74a9c391e9
commit 7fd6b6ab51

View File

@ -239,10 +239,12 @@ class Api:
def extract(self, ship, survey=None):
data = {}
url = f'my/ships/{ship}/extract'
if survey is not None:
data['survey'] = survey.api_dict()
url += '/survey'
try:
data = self.request('post', f'my/ships/{ship}/extract', data=data)
data = self.request('post', url, data=data)
except ApiError as e:
if e.code in [ 4221, 4224]:
survey.exhausted = True