Implement patch
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
<div class="w-3/4 p-6">
|
<div class="w-3/4 p-6">
|
||||||
<div class="bg-gray-700 text-white p-4 flex justify-between">
|
<div class="bg-gray-700 text-white p-4 flex justify-between">
|
||||||
<span>Review document before confirming</span>
|
<span>Review document before confirming</span>
|
||||||
<button class="bg-red-600 px-4 py-2 rounded">Confirm</button>
|
<button class="bg-red-600 px-4 py-2 rounded cursor-pointer" (click)="onConfirm()">Confirm</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-white p-6 shadow-lg mt-4">
|
<div class="bg-white p-6 shadow-lg mt-4">
|
||||||
|
@ -2,7 +2,7 @@ import {Component, OnInit} from '@angular/core';
|
|||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {
|
import {
|
||||||
GetSigningRequestResponse,
|
GetSigningRequestResponse,
|
||||||
GetSigningRequestResponseSigningRequestDocument,
|
GetSigningRequestResponseSigningRequestDocument, PatchOperation, SigningRequestDocumentService,
|
||||||
SigningRequestService
|
SigningRequestService
|
||||||
} from '../../../gen';
|
} from '../../../gen';
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ export class SigningComponent implements OnInit {
|
|||||||
confirmed: false, id: '', name: ''
|
confirmed: false, id: '', name: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private signingRequestService: SigningRequestService) {
|
constructor(private route: ActivatedRoute, private signingRequestService: SigningRequestService, private signingRequestDocumentService: SigningRequestDocumentService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@ -38,4 +38,16 @@ export class SigningComponent implements OnInit {
|
|||||||
this.selectedDocument = document;
|
this.selectedDocument = document;
|
||||||
console.log(this.selectedDocument);
|
console.log(this.selectedDocument);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onConfirm(): void {
|
||||||
|
this.patchDocument(this.selectedDocument);
|
||||||
|
}
|
||||||
|
|
||||||
|
patchDocument(signingRequestDocument: GetSigningRequestResponseSigningRequestDocument): void {
|
||||||
|
const patch: PatchOperation = {
|
||||||
|
op: "replace", path: "/confirmed", value: "true"
|
||||||
|
}
|
||||||
|
this.signingRequestDocumentService.patchSigningRequestDocument(this.selectedDocument.id, Array.of(patch));
|
||||||
|
this.selectedDocument.confirmed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user