Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
#121: Implement the UI to connect manage the certificate of the PKI
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanSAG committed Jun 7, 2022
1 parent ea322d8 commit 7e0d4ce
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkiintergration-fe/src/services/operation.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Injectable } from '@angular/core';
import { IOperation } from '@c8y/client';
import { OperationService } from '@c8y/ngx-components/api';

@Injectable({ providedIn: 'root' })
export class yourService {
constructor(private operationService: OperationService) {}

async requestPubKey(deviceId: string): Promise<IOperation> {
// http://resources.cumulocity.com/documentation/websdk/client/interfaces/ioperation.html
const operation: IOperation = {
request_pubkey: {},
deviceId
};
// http://resources.cumulocity.com/documentation/websdk/client/classes/operationservice.html#create
const { res, data } = await this.operationService.create(operation);
return data;
}
}

0 comments on commit 7e0d4ce

Please sign in to comment.