Locales cleanup
This commit is contained in:
16
frontend/src/api/npm/createCertificate.ts
Normal file
16
frontend/src/api/npm/createCertificate.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as api from "./base";
|
||||
import { Certificate } from "./models";
|
||||
|
||||
export async function createCertificate(
|
||||
data: Certificate,
|
||||
abortController?: AbortController,
|
||||
): Promise<Certificate> {
|
||||
const { result } = await api.post(
|
||||
{
|
||||
url: "/certificates",
|
||||
data,
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
return result;
|
||||
}
|
13
frontend/src/api/npm/getCertificate.ts
Normal file
13
frontend/src/api/npm/getCertificate.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as api from "./base";
|
||||
import { Certificate } from "./models";
|
||||
|
||||
export async function getCertificate(
|
||||
id: number,
|
||||
params = {},
|
||||
): Promise<Certificate> {
|
||||
const { result } = await api.get({
|
||||
url: `/certificates/${id}`,
|
||||
params,
|
||||
});
|
||||
return result;
|
||||
}
|
@@ -1,7 +1,9 @@
|
||||
export * from "./createCertificate";
|
||||
export * from "./createCertificateAuthority";
|
||||
export * from "./createDNSProvider";
|
||||
export * from "./createUser";
|
||||
export * from "./getAccessLists";
|
||||
export * from "./getCertificate";
|
||||
export * from "./getCertificateAuthorities";
|
||||
export * from "./getCertificateAuthority";
|
||||
export * from "./getCertificates";
|
||||
@@ -22,6 +24,7 @@ export * from "./models";
|
||||
export * from "./refreshToken";
|
||||
export * from "./responseTypes";
|
||||
export * from "./setAuth";
|
||||
export * from "./setCertificate";
|
||||
export * from "./setCertificateAuthority";
|
||||
export * from "./setDNSProvider";
|
||||
export * from "./setUser";
|
||||
|
17
frontend/src/api/npm/setCertificate.ts
Normal file
17
frontend/src/api/npm/setCertificate.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as api from "./base";
|
||||
import { Certificate } from "./models";
|
||||
|
||||
export async function setCertificate(
|
||||
id: number,
|
||||
data: any,
|
||||
): Promise<Certificate> {
|
||||
if (data.id) {
|
||||
delete data.id;
|
||||
}
|
||||
|
||||
const { result } = await api.put({
|
||||
url: `/certificates/${id}`,
|
||||
data,
|
||||
});
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user