Locales cleanup

This commit is contained in:
Jamie Curnow
2023-01-16 15:50:40 +10:00
parent af9349d4a7
commit 374447ccc7
26 changed files with 142 additions and 374 deletions

View 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;
}

View 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;
}

View File

@@ -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";

View 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;
}