Update the public key and the endpoint
This commit is contained in:
parent
6cf3bf0255
commit
f99efbb1e9
1 changed files with 10 additions and 0 deletions
|
@ -78,6 +78,16 @@ export const handleGetConfigMessage: MessageHandler = async (context) => {
|
||||||
|
|
||||||
logger.info(`Updated site ${siteId} with new WG Newt info`);
|
logger.info(`Updated site ${siteId} with new WG Newt info`);
|
||||||
} else {
|
} else {
|
||||||
|
// update the endpoint and the public key
|
||||||
|
const [siteRes] = await db
|
||||||
|
.update(sites)
|
||||||
|
.set({
|
||||||
|
publicKey,
|
||||||
|
endpoint
|
||||||
|
})
|
||||||
|
.where(eq(sites.siteId, siteId))
|
||||||
|
.returning();
|
||||||
|
|
||||||
site = siteRes;
|
site = siteRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue