diff --git a/backend/openapi.yml b/backend/openapi.yml index ab1dae13de..7ed82240cd 100644 --- a/backend/openapi.yml +++ b/backend/openapi.yml @@ -164,7 +164,7 @@ paths: description: Unauthorized "500": description: Internal Server Error - /api/v1/agreements/{agreement_id}/history: + /api/v1/agreements-history/{agreement_id}: get: operationId: getAgreementHistoryById description: Get Agreement History By Id diff --git a/backend/ops_api/ops/urls.py b/backend/ops_api/ops/urls.py index 77a22f2474..2a1997c42c 100644 --- a/backend/ops_api/ops/urls.py +++ b/backend/ops_api/ops/urls.py @@ -199,7 +199,7 @@ def register_api(api_bp: Blueprint) -> None: view_func=AGREEMENT_LIST_API_VIEW_FUNC, ) api_bp.add_url_rule( - "/agreements//history/", + "/agreement-history/", view_func=AGREEMENT_HISTORY_LIST_API_VIEW_FUNC, ) api_bp.add_url_rule( diff --git a/backend/ops_api/tests/ops/agreement/test_agreement_history.py b/backend/ops_api/tests/ops/agreement/test_agreement_history.py index f3cb1bb5af..2df0203f0b 100644 --- a/backend/ops_api/tests/ops/agreement/test_agreement_history.py +++ b/backend/ops_api/tests/ops/agreement/test_agreement_history.py @@ -89,7 +89,7 @@ def test_agreement_history(auth_client, loaded_db, test_can): resp = auth_client.delete(f"/api/v1/agreements/{agreement_id}") assert resp.status_code == 200 - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?offset=0&limit=20") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?offset=0&limit=20") assert resp.status_code == 200 data = resp.json assert len(data) == 6 @@ -142,7 +142,7 @@ def test_agreement_history_log_items(auth_client, app, test_can): # verify agreement history (+1 agreement created) prev_hist_count = 0 - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -168,7 +168,7 @@ def test_agreement_history_log_items(auth_client, app, test_can): assert resp.status_code == 200 # verify agreement history (+1 agreement updated) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -205,7 +205,7 @@ def test_agreement_history_log_items(auth_client, app, test_can): assert bli.id is not None # verify agreement history added (+1 BLI created) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -229,7 +229,7 @@ def test_agreement_history_log_items(auth_client, app, test_can): session.commit() # verify agreement history added (+1 BLI update with 3 log_item) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -259,7 +259,7 @@ def test_agreement_history_log_items(auth_client, app, test_can): session.commit() # verify agreement history added (+1 BLI created) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -334,7 +334,7 @@ def test_agreement_history_log_items_with_change_requests(auth_client, loaded_db assert len(change_requests_in_review) == 3 # verify agreement history added (+3 change requests created) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 hist_json = resp.json hist_count = len(hist_json) @@ -370,7 +370,7 @@ def test_agreement_history_log_items_with_change_requests(auth_client, loaded_db assert response.status_code == 200 # verify agreement history added for 3 reviews and 3 approved updates - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 hist_json = resp.json hist_count = len(hist_json) diff --git a/backend/ops_api/tests_manual/ops/test_change_requests.py b/backend/ops_api/tests_manual/ops/test_change_requests.py index e072874047..b871c52905 100644 --- a/backend/ops_api/tests_manual/ops/test_change_requests.py +++ b/backend/ops_api/tests_manual/ops/test_change_requests.py @@ -341,7 +341,7 @@ def test_agreement_history_with_change_requests(auth_client, app): # verify agreement history (+1 agreement created) prev_hist_count = 0 - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -367,7 +367,7 @@ def test_agreement_history_with_change_requests(auth_client, app): assert resp.status_code == 200 # verify agreement history (+1 agreement updated) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -405,7 +405,7 @@ def test_agreement_history_with_change_requests(auth_client, app): bli_id = bli.id # verify agreement history added (+1 BLI created) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -429,7 +429,7 @@ def test_agreement_history_with_change_requests(auth_client, app): session.commit() # verify agreement history added (+1 BLI update with 3 log_item) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -459,7 +459,7 @@ def test_agreement_history_with_change_requests(auth_client, app): session.commit() # verify agreement history added (+1 BLI created) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) @@ -487,7 +487,7 @@ def test_agreement_history_with_change_requests(auth_client, app): assert len(change_requests_in_review) == 3 # verify agreement history added (+3 change requests created) - resp = auth_client.get(f"/api/v1/agreements/{agreement_id}/history/?limit=100") + resp = auth_client.get(f"/api/v1/agreement-history/{agreement_id}?limit=100") assert resp.status_code == 200 resp_json = resp.json hist_count = len(resp_json) diff --git a/frontend/src/api/getAgreementHistory.js b/frontend/src/api/getAgreementHistory.js index 0160865f2a..04566cc249 100644 --- a/frontend/src/api/getAgreementHistory.js +++ b/frontend/src/api/getAgreementHistory.js @@ -5,7 +5,7 @@ export const getAgreementHistoryByIdAndPage = async (id, page) => { const limit = pageSize; const offset = pageSize * (page - 1); const api_version = ApplicationContext.get().helpers().backEndConfig.apiVersion; - const endpoint = `/api/${api_version}/agreements/${id}/history/?limit=${limit}&offset=${offset}`; + const endpoint = `/api/${api_version}/agreement-history/${id}?limit=${limit}&offset=${offset}`; const responseData = await ApplicationContext.get().helpers().callBackend(endpoint, "get"); return responseData; };