Skip to content

Commit

Permalink
Merge pull request #469 from bcgov/dev
Browse files Browse the repository at this point in the history
ticket 4183 revised push to main
  • Loading branch information
Aman-Hundal authored Sep 12, 2023
2 parents 8e93652 + 1671789 commit 443fa4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion api/reviewer_api/resources/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def get(requestid):
timeout=float(requestapitimeout)
)
response.raise_for_status()
result = documentservice().getdocuments(requestid)
bcgovcode = response.json()['bcgovcode']
result = documentservice().getdocuments(requestid,bcgovcode)
return json.dumps(result), 200
except KeyError as err:
return {'status': False, 'message':err.messages}, 400
Expand Down
6 changes: 3 additions & 3 deletions api/reviewer_api/services/documentservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@ def updatedocumentattributes(self, payload, userid):

return DocumentAttributes.update(newRows, oldRows)

def getdocuments(self, requestid):
def getdocuments(self, requestid,bcgovcode):
divisions_data = requests.request(
method='GET',
url=requestapiurl + "/api/foiflow/divisions",
url=requestapiurl + "/api/foiflow/divisions/{0}".format(bcgovcode),
headers={'Authorization': AuthHelper.getauthtoken(), 'Content-Type': 'application/json'}
).json()
divisions = {div['divisionid']: div for div in divisions_data}
divisions = {div['divisionid']: div for div in divisions_data['divisions']}

documents = {document['documentmasterid']: document for document in self.getdedupestatus(requestid)}
attachments = []
Expand Down

0 comments on commit 443fa4b

Please sign in to comment.