add save default view

This commit is contained in:
miloschwartz
2026-07-02 22:27:51 -04:00
parent 12f9ac94fd
commit f0546eb622
18 changed files with 665 additions and 75 deletions
@@ -9,6 +9,7 @@ import moment from "moment";
import { fromZodError } from "zod-validation-error";
import { z } from "zod";
import { ActionsEnum, checkUserActionPermission } from "@server/auth/actions";
import { isLauncherDefaultOverrideViewName } from "./launcherDefaultView";
import { launcherViewConfigSchema } from "./types";
const updateLauncherViewBodySchema = z.strictObject({
@@ -66,6 +67,15 @@ export async function updateLauncherView(
);
}
if (isLauncherDefaultOverrideViewName(existing.name)) {
return next(
createHttpError(
HttpCode.BAD_REQUEST,
"Use the default view save endpoint for this view"
)
);
}
const isPersonalView = existing.userId === userId;
const isOrgWideView = existing.userId == null;
const canManageOrgWide = await checkUserActionPermission(