Commit 21f072538b855d9c99f76f5d2c7c80689865297b
1 parent
9366056c
getTenderDataByTenderCancellationsUaId
Showing
1 changed file
with
20 additions
and
0 deletions
... | ... | @@ -476,6 +476,26 @@ def prepare_tender_data_cancellation(data_original): |
476 | 476 | |
477 | 477 | return b |
478 | 478 | |
479 | +def getTenderDataByTenderCancellationsUaId(apiBaseUrl, tenderUaId): | |
480 | + requestData = {"opt_fields": "tenderID", "descending": "1", "mode": "_all_"} | |
481 | + updatesResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders", data=requestData) | |
482 | + if "json" not in updatesResponse: | |
483 | + print('json key not found') | |
484 | + return {} | |
485 | + tenderId = None | |
486 | + print("lastTenders:") | |
487 | + print(updatesResponse['json']['data']) | |
488 | + for item in updatesResponse['json']['data']: | |
489 | + if tenderUaId == item['tenderID']: | |
490 | + tenderId = item['id'] | |
491 | + break | |
492 | + if tenderId is None: | |
493 | + return {} | |
494 | + tenderDataResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders/" + tenderId + "/cancellations", data={}) | |
495 | + tenderDataJson = tenderDataResponse['json'] | |
496 | + return tenderDataJson | |
497 | + | |
498 | + | |
479 | 499 | def getLastComplaintDataByTenderUaId(apiBaseUrl, tenderUaId): |
480 | 500 | requestData = {"opt_fields": "tenderID", "descending": "1", "mode": "_all_"} |
481 | 501 | updatesResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders", data=requestData) | ... | ... |
Please
register
or
login
to post a comment