♻️ refactor docker and websocket blueprint to call the new applyBlueprint function

This commit is contained in:
Fred KISSIE
2025-10-29 03:07:55 +01:00
parent 2783d2989d
commit 4c567cf2d7
2 changed files with 12 additions and 2 deletions

View File

@@ -30,7 +30,12 @@ export async function applyNewtDockerBlueprint(
logger.debug(`Received Docker blueprint: ${JSON.stringify(blueprint)}`);
// Update the blueprint in the database
await applyBlueprint(site.orgId, blueprint, site.siteId);
await applyBlueprint({
orgId: site.orgId,
configData: blueprint,
siteId: site.siteId,
source: "NEWT"
});
} catch (error) {
logger.error(`Failed to update database from config: ${error}`);
await sendToClient(newtId, {

View File

@@ -43,7 +43,12 @@ export const handleApplyBlueprintMessage: MessageHandler = async (context) => {
try {
const blueprintParsed = JSON.parse(blueprint);
// Update the blueprint in the database
await applyBlueprint(site.orgId, blueprintParsed, site.siteId);
await applyBlueprint({
orgId: site.orgId,
configData: blueprintParsed,
siteId: site.siteId,
source: "NEWT"
});
} catch (error) {
logger.error(`Failed to update database from config: ${error}`);
return {