Skip to content

Commit

Permalink
Merge pull request #735 from companieshouse/lp-364-update-limited-par…
Browse files Browse the repository at this point in the history
…tnership-update-patch

LP-367 Limited partnerships - Update PATCH function data parameter
  • Loading branch information
mattch1 authored Jan 8, 2025
2 parents 2061270 + c04bda9 commit 479d845
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/services/limited-partnerships/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ export default class LimitedPartnershipsService {
public async patchLimitedPartnership (
transactionId: string,
submissionId: string,
body: { type: string; data: Record<string, any> }
body: LimitedPartnership["data"]
): Promise<Resource<void> | ApiErrorResponse> {
const URL = `/transactions/${transactionId}/limited-partnership/partnership/${submissionId}`;
const response: HttpResponse = await this.client.httpPatch(URL, body);

if (response.error) {
return {
httpStatusCode: response.status,
Expand Down
17 changes: 4 additions & 13 deletions test/services/limited-partnerships/limited.partnerships.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ describe("LimitedPartnershipsService", () => {
mockValues.TRANSACTION_ID,
mockValues.SUBMISSION_ID,
{
type: "email",
data: {
email: "[email protected]"
}
email: "[email protected]"
}
);

Expand All @@ -140,10 +137,7 @@ describe("LimitedPartnershipsService", () => {
mockRequest.calledWith(
"/transactions/12345/limited-partnership/partnership/09876",
{
type: "email",
data: {
email: "[email protected]"
}
email: "[email protected]"
}
)
).to.be.true;
Expand All @@ -163,8 +157,7 @@ describe("LimitedPartnershipsService", () => {
mockValues.TRANSACTION_ID,
mockValues.SUBMISSION_ID,
{
type: "email",
data: {}
email: "testemail.com"
}
) as ApiErrorResponse;

Expand All @@ -173,9 +166,7 @@ describe("LimitedPartnershipsService", () => {
mockRequest.calledWith(
"/transactions/12345/limited-partnership/partnership/09876",
{
type: "email",
data: {}

email: "testemail.com"
}
)
).to.be.true;
Expand Down

0 comments on commit 479d845

Please sign in to comment.