diff --git a/backend/Api/Agreements/AgreementController.cs b/backend/Api/Agreements/AgreementController.cs index 8bb99f40..53a17766 100644 --- a/backend/Api/Agreements/AgreementController.cs +++ b/backend/Api/Agreements/AgreementController.cs @@ -23,7 +23,7 @@ public class AgreementController( [HttpGet] - [Route("get/{agreementId:int}")] + [Route("{agreementId:int}")] public async Task> GetAgreement([FromRoute] string orgUrlKey, [FromRoute] int agreementId, CancellationToken ct) { @@ -52,7 +52,7 @@ public async Task> GetAgreement([FromRoute] str } [HttpGet] - [Route("get/engagement/{engagementId:int}")] + [Route("engagement/{engagementId:int}")] public async Task>> GetAgreementsByEngagement([FromRoute] string orgUrlKey, [FromRoute] int engagementId, CancellationToken ct) { @@ -80,7 +80,7 @@ public async Task>> GetAgreementsByEngagem } [HttpGet] - [Route("get/customer/{customerId:int}")] + [Route("customer/{customerId:int}")] public async Task>> GetAgreementsByCustomer([FromRoute] string orgUrlKey, [FromRoute] int customerId, CancellationToken ct) { @@ -108,7 +108,6 @@ public async Task>> GetAgreementsByCustome } [HttpPost] - [Route("create")] public async Task> Post([FromRoute] string orgUrlKey, [FromBody] AgreementWriteModel body, CancellationToken cancellationToken) { @@ -190,7 +189,7 @@ public async Task> Post([FromRoute] string orgU } [HttpPut] - [Route("update/{agreementId:int}")] + [Route("{agreementId:int}")] public async Task> Put([FromRoute] string orgUrlKey, [FromRoute] int agreementId, [FromBody] AgreementWriteModel body, CancellationToken cancellationToken) { @@ -283,7 +282,7 @@ public async Task> Put([FromRoute] string orgUr } [HttpDelete] - [Route("delete/{agreementId:int}")] + [Route("{agreementId:int}")] public async Task Delete([FromRoute] string orgUrlKey, [FromRoute] int agreementId, CancellationToken ct) { var selectedOrg = await organisationRepository.GetOrganizationByUrlKey(orgUrlKey, ct); diff --git a/frontend/src/actions/agreementActions.ts b/frontend/src/actions/agreementActions.ts index baf87687..330e9971 100644 --- a/frontend/src/actions/agreementActions.ts +++ b/frontend/src/actions/agreementActions.ts @@ -135,7 +135,7 @@ export async function getAgreementsForProject( ) { try { const res = await fetchWithToken( - `${orgUrlKey}/agreements/get/engagement/${projectId}`, + `${orgUrlKey}/agreements/engagement/${projectId}`, ); let agreementsWithDateTypes: Agreement[] = []; @@ -154,7 +154,7 @@ export async function getAgreementsForCustomer( ) { try { const res = await fetchWithToken( - `${orgUrlKey}/agreements/get/customer/${customerId}`, + `${orgUrlKey}/agreements/customer/${customerId}`, ); let agreementsWithDateTypes: Agreement[] = []; @@ -170,7 +170,7 @@ export async function getAgreementsForCustomer( export async function updateAgreement(agreement: Agreement, orgUrlKey: string) { try { const res = await putWithToken( - `${orgUrlKey}/agreements/update/${agreement.agreementId}`, + `${orgUrlKey}/agreements/${agreement.agreementId}`, agreement, ); @@ -190,7 +190,7 @@ export async function createAgreement( ) { try { const res = await postWithToken( - `${orgUrlKey}/agreements/create`, + `${orgUrlKey}/agreements`, agreement, ); let agreementWithDateTypes: Agreement | null = null; @@ -206,7 +206,7 @@ export async function createAgreement( export async function deleteAgreement(agreementId: number, orgUrlKey: string) { try { const res = await deleteWithToken( - `${orgUrlKey}/agreements/delete/${agreementId}`, + `${orgUrlKey}/agreements/${agreementId}`, ); return res;