Custom certificate upload

This commit is contained in:
Jamie Curnow
2025-10-27 19:26:33 +10:00
parent 0de26f2950
commit 83a2c79e16
7 changed files with 216 additions and 40 deletions

View File

@@ -1,14 +1,9 @@
import * as api from "./base";
import type { Certificate } from "./models";
export async function uploadCertificate(
id: number,
certificate: string,
certificateKey: string,
intermediateCertificate?: string,
): Promise<Certificate> {
export async function uploadCertificate(id: number, data: FormData): Promise<Certificate> {
return await api.post({
url: `/nginx/certificates/${id}/upload`,
data: { certificate, certificateKey, intermediateCertificate },
data,
});
}

View File

@@ -1,13 +1,9 @@
import * as api from "./base";
import type { ValidatedCertificateResponse } from "./responseTypes";
export async function validateCertificate(
certificate: string,
certificateKey: string,
intermediateCertificate?: string,
): Promise<ValidatedCertificateResponse> {
export async function validateCertificate(data: FormData): Promise<ValidatedCertificateResponse> {
return await api.post({
url: "/nginx/certificates/validate",
data: { certificate, certificateKey, intermediateCertificate },
data,
});
}