styles, form, backend partial

This commit is contained in:
2024-10-18 13:12:19 +02:00
parent edd3be3659
commit 0b44dfef30
11 changed files with 530 additions and 71 deletions

21
lib/listmonk.ts Normal file
View File

@ -0,0 +1,21 @@
import "server-only";
async function makeApiCall(url: string, options?: RequestInit) {
try {
const response = await fetch(url, options);
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error("Error making API call:", error);
throw error;
}
}
async function listmonk() {
const listmonkUrl = process.env.LISTMONK_URL ?? "";
makeApiCall(listmonkUrl);
}
export default listmonk;