mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-08 11:00:34 +00:00
♻️ refactor docker and websocket blueprint to call the new applyBlueprint function
This commit is contained in:
@@ -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, {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user