Merge branch 'dev' into audit-logs

This commit is contained in:
Owen
2025-10-24 10:31:54 -07:00
9 changed files with 52 additions and 70 deletions

View File

@@ -224,7 +224,7 @@ export async function signup(
res.appendHeader("Set-Cookie", cookie);
if (build == "saas") {
moveEmailToAudience(email, AudienceIds.General);
moveEmailToAudience(email, AudienceIds.SignUps);
}
if (config.getRawConfig().flags?.require_email_verification) {

View File

@@ -443,14 +443,14 @@ authenticated.post(
resource.setResourceWhitelist,
);
authenticated.get(
authenticated.post(
`/resource/:resourceId/whitelist/add`,
verifyApiKeyResourceAccess,
verifyApiKeyHasAction(ActionsEnum.setResourceWhitelist),
resource.addEmailToResourceWhitelist
);
authenticated.get(
authenticated.post(
`/resource/:resourceId/whitelist/remove`,
verifyApiKeyResourceAccess,
verifyApiKeyHasAction(ActionsEnum.setResourceWhitelist),

View File

@@ -17,7 +17,7 @@ const getOrgSchema = z
.strict();
export type GetOrgResponse = {
org: Org & { settings: { } | null };
org: Org;
};
registry.registerPath({
@@ -64,23 +64,9 @@ export async function getOrg(
);
}
// Parse settings from JSON string back to object
let parsedSettings = null;
if (org[0].settings) {
try {
parsedSettings = JSON.parse(org[0].settings);
} catch (error) {
// If parsing fails, keep as string for backward compatibility
parsedSettings = org[0].settings;
}
}
return response<GetOrgResponse>(res, {
data: {
org: {
...org[0],
settings: parsedSettings
}
org: org[0]
},
success: true,
error: false,

View File

@@ -12,15 +12,13 @@ import { OpenAPITags, registry } from "@server/openApi";
const updateOrgParamsSchema = z
.object({
orgId: z.string(),
orgId: z.string()
})
.strict();
const updateOrgBodySchema = z
.object({
name: z.string().min(1).max(255).optional(),
settings: z.object({
}).optional(),
name: z.string().min(1).max(255).optional()
})
.strict()
.refine((data) => Object.keys(data).length > 0, {
@@ -73,13 +71,10 @@ export async function updateOrg(
const { orgId } = parsedParams.data;
const settings = parsedBody.data.settings ? JSON.stringify(parsedBody.data.settings) : undefined;
const updatedOrg = await db
.update(orgs)
.set({
name: parsedBody.data.name,
settings: settings
name: parsedBody.data.name
})
.where(eq(orgs.orgId, orgId))
.returning();