newts not being on when olm is started

This commit is contained in:
Owen
2025-04-13 21:28:11 -04:00
parent b7ae712b63
commit 569635f3ed
7 changed files with 150 additions and 35 deletions

View File

@@ -18,7 +18,7 @@ export async function addPeer(siteId: number, peer: {
// get the newt on the site
const [newt] = await db.select().from(newts).where(eq(newts.siteId, siteId)).limit(1);
if (!newt) {
throw new Error(`Newt not found for site ${siteId}`);
throw new Error(`Site found for site ${siteId}`);
}
sendToClient(newt.newtId, {
@@ -32,7 +32,7 @@ export async function addPeer(siteId: number, peer: {
export async function deletePeer(siteId: number, publicKey: string) {
const [site] = await db.select().from(sites).where(eq(sites.siteId, siteId)).limit(1);
if (!site) {
throw new Error(`Exit node with ID ${siteId} not found`);
throw new Error(`Site with ID ${siteId} not found`);
}
// get the newt on the site
@@ -57,7 +57,7 @@ export async function updatePeer(siteId: number, publicKey: string, peer: {
}) {
const [site] = await db.select().from(sites).where(eq(sites.siteId, siteId)).limit(1);
if (!site) {
throw new Error(`Exit node with ID ${siteId} not found`);
throw new Error(`Site with ID ${siteId} not found`);
}
// get the newt on the site