mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-12-22 11:59:45 +00:00
Implements certificate delete ui
This commit is contained in:
@@ -99,3 +99,21 @@ export async function put(
|
||||
const response = await fetch(apiUrl, { method, headers, body, signal });
|
||||
return processResponse(response, skipCamelize);
|
||||
}
|
||||
|
||||
interface DeleteArgs {
|
||||
url: string;
|
||||
}
|
||||
export async function del(
|
||||
{ url }: DeleteArgs,
|
||||
abortController?: AbortController,
|
||||
) {
|
||||
const apiUrl = buildUrl({ url });
|
||||
const method = "DELETE";
|
||||
const headers = {
|
||||
...buildAuthHeader(),
|
||||
[contentTypeHeader]: "application/json",
|
||||
};
|
||||
const signal = abortController?.signal;
|
||||
const response = await fetch(apiUrl, { method, headers, signal });
|
||||
return processResponse(response);
|
||||
}
|
||||
|
||||
14
frontend/src/api/npm/deleteCertificate.ts
Normal file
14
frontend/src/api/npm/deleteCertificate.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as api from "./base";
|
||||
|
||||
export async function deleteCertificate(
|
||||
id: number,
|
||||
abortController?: AbortController,
|
||||
): Promise<boolean> {
|
||||
const { result } = await api.del(
|
||||
{
|
||||
url: `/certificates/${id}`,
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
return result;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ export * from "./createCertificate";
|
||||
export * from "./createCertificateAuthority";
|
||||
export * from "./createDNSProvider";
|
||||
export * from "./createUser";
|
||||
export * from "./deleteCertificate";
|
||||
export * from "./getAccessLists";
|
||||
export * from "./getCertificate";
|
||||
export * from "./getCertificateAuthorities";
|
||||
|
||||
Reference in New Issue
Block a user