Skip to content

Commit

Permalink
chore(3314): enforce distinct PO and TL idir for edit requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinedu Olebu committed Nov 13, 2024
1 parent fa173cd commit 5b0f98c
Show file tree
Hide file tree
Showing 9 changed files with 2,898 additions and 1,896 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async function makeBasicProductChange(extra = {}) {
const response = await editPrivateCloudProject(requests.create.licencePlate, {
...requests.create.decisionData,
developmentQuota: newDevelopmentQuota,
isAgMinistryChecked: true,
...extra,
});

Expand Down
3 changes: 2 additions & 1 deletion app/app/api/private-cloud/products/_operations/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default async function updateOp({
return UnauthorizedResponse();
}

const { requestComment, quotaContactName, quotaContactEmail, quotaJustification, ...rest } = body;
const { requestComment, quotaContactName, quotaContactEmail, quotaJustification, isAgMinistryChecked, ...rest } =
body;

if (!product._permissions.manageMembers) {
rest.members = product.members;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ describe('Review Private Cloud Update Request - Permissions', () => {
const response = await editPrivateCloudProject(requests.main.licencePlate, {
...requests.main.decisionData,
developmentQuota: newDevelopmentQuota,
isAgMinistryChecked: true,
});

expect(response.status).toBe(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ async function makeBasicProductChange(extra = {}) {
...requests.create.decisionData,
accountCoding: requests.create.decisionData.billing.accountCoding,
environmentsEnabled: newEnvironmentsEnabled,
isAgMinistryChecked: true,
...extra,
});

Expand Down
2 changes: 1 addition & 1 deletion app/app/api/public-cloud/products/_operations/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function updateOp({
return UnauthorizedResponse();
}

const { requestComment, accountCoding, ...rest } = body;
const { requestComment, accountCoding, isAgMinistryChecked, isEaApproval, ...rest } = body;

if (!product._permissions.manageMembers) {
rest.members = product.members;
Expand Down
2 changes: 2 additions & 0 deletions app/app/api/public-cloud/requests/[id]/decision/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ describe('Review Public Cloud Update Request - Permissions', () => {
...requests.main.decisionData,
accountCoding: requests.main.decisionData.billing.accountCoding,
environmentsEnabled: newEnvironmentsEnabled,
isAgMinistryChecked: true,
});

expect(response.status).toBe(200);

requests.main = await response.json();
Expand Down
Loading

0 comments on commit 5b0f98c

Please sign in to comment.