mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 17:26:38 +00:00
♻️ only include org settings in saas build
This commit is contained in:
@@ -24,7 +24,7 @@ import HttpCode from "@server/types/HttpCode";
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq, InferInsertModel } from "drizzle-orm";
|
||||||
import { getOrgTierData } from "#private/lib/billing";
|
import { getOrgTierData } from "#private/lib/billing";
|
||||||
import { TierId } from "@server/lib/billing/tiers";
|
import { TierId } from "@server/lib/billing/tiers";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
@@ -40,10 +40,10 @@ const bodySchema = z
|
|||||||
logoUrl: z.string().url(),
|
logoUrl: z.string().url(),
|
||||||
logoWidth: z.coerce.number().min(1),
|
logoWidth: z.coerce.number().min(1),
|
||||||
logoHeight: z.coerce.number().min(1),
|
logoHeight: z.coerce.number().min(1),
|
||||||
title: z.string(),
|
|
||||||
subtitle: z.string().optional(),
|
|
||||||
resourceTitle: z.string(),
|
resourceTitle: z.string(),
|
||||||
resourceSubtitle: z.string().optional()
|
resourceSubtitle: z.string().optional(),
|
||||||
|
orgTitle: z.string().optional(),
|
||||||
|
orgSubtitle: z.string().optional()
|
||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
@@ -65,8 +65,6 @@ export async function upsertLoginPageBranding(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateData = parsedBody.data;
|
|
||||||
|
|
||||||
const parsedParams = paramsSchema.safeParse(req.params);
|
const parsedParams = paramsSchema.safeParse(req.params);
|
||||||
if (!parsedParams.success) {
|
if (!parsedParams.success) {
|
||||||
return next(
|
return next(
|
||||||
@@ -92,6 +90,16 @@ export async function upsertLoginPageBranding(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let updateData = parsedBody.data satisfies InferInsertModel<
|
||||||
|
typeof loginPageBranding
|
||||||
|
>;
|
||||||
|
|
||||||
|
if (build !== "saas") {
|
||||||
|
// org branding settings are only considered in the saas build
|
||||||
|
const { orgTitle, orgSubtitle, ...rest } = updateData;
|
||||||
|
updateData = rest;
|
||||||
|
}
|
||||||
|
|
||||||
const [existingLoginPageBranding] = await db
|
const [existingLoginPageBranding] = await db
|
||||||
.select()
|
.select()
|
||||||
.from(loginPageBranding)
|
.from(loginPageBranding)
|
||||||
|
|||||||
Reference in New Issue
Block a user