diff --git a/server/lib/blueprints/applyBlueprint.ts b/server/lib/blueprints/applyBlueprint.ts index 235a1591..b3e58824 100644 --- a/server/lib/blueprints/applyBlueprint.ts +++ b/server/lib/blueprints/applyBlueprint.ts @@ -166,7 +166,8 @@ export async function applyBlueprint({ blueprint = newBlueprint[0]; }); - if (!blueprint || !blueprintSucceeded) { + if (!blueprint || (source !== "UI" && !blueprintSucceeded)) { + // ^^^^^^^^^^^^^^^ The UI considers a failed blueprint as a valid response throw error ?? "Unknown Server Error"; } diff --git a/src/components/CreateBlueprintForm.tsx b/src/components/CreateBlueprintForm.tsx index 62328114..617f3026 100644 --- a/src/components/CreateBlueprintForm.tsx +++ b/src/components/CreateBlueprintForm.tsx @@ -107,10 +107,11 @@ export default function CreateBlueprintForm({ }); if (res && res.status === 201) { + const createdBlueprint = res.data.data; toast({ - variant: "default", - title: "Success", - description: res.data.data.message + variant: "warning", + title: createdBlueprint.succeeded ? "Success" : "Warning", + description: createdBlueprint.message }); router.push(`/${orgId}/settings/blueprints`); } diff --git a/src/components/ui/toast.tsx b/src/components/ui/toast.tsx index 26510e84..5f1e5d19 100644 --- a/src/components/ui/toast.tsx +++ b/src/components/ui/toast.tsx @@ -31,7 +31,8 @@ const toastVariants = cva( variant: { default: "border bg-card text-foreground", destructive: - "destructive group border-destructive bg-destructive text-white dark:text-destructive-foreground" + "destructive group border-destructive bg-destructive text-white dark:text-destructive-foreground", + warning: "group border-amber-600 bg-amber-600 text-white" } }, defaultVariants: {