Files
calendar/packages/trpc/server/routers/viewer/attributes/_router.ts
T
Keith WilliamsGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>keith@cal.com <keith@cal.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>keith@cal.com <keith@cal.com>keith@cal.com <keith@cal.com>keith@cal.com <keith@cal.com>devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>keith@cal.com <keith@cal.com>
6615b885d1 chore: Make app compatible with Fluid Compute (#19841)
* chore: Make app compatible with Fluid Compute

* Removed isCold from me api endpoint

* chore: Remove handler caching for Fluid Compute compatibility (#20692)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: keith@cal.com <keith@cal.com>

* fix client_id issue

* chore: Remove UNSTABLE_HANDLER_CACHE for Fluid Compute compatibility (#20694)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: keith@cal.com <keith@cal.com>

* Fixing types

* Fixing type issues

* chore: Remove importHandler references for Fluid Compute compatibility

Co-Authored-By: keith@cal.com <keith@cal.com>

* chore: Remove importHandler references from attributes router for Fluid Compute compatibility

Co-Authored-By: keith@cal.com <keith@cal.com>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: keith@cal.com <keith@cal.com>
2025-04-14 18:27:59 -04:00

71 lines
3.1 KiB
TypeScript

import type { z } from "zod";
import authedProcedure, { authedOrgAdminProcedure } from "../../../procedures/authedProcedure";
import { router } from "../../../trpc";
import { assignUserToAttributeSchema } from "./assignUserToAttribute.schema";
import { bulkAssignAttributesSchema } from "./bulkAssignAttributes.schema";
import { createAttributeSchema } from "./create.schema";
import { deleteAttributeSchema } from "./delete.schema";
import { editAttributeSchema } from "./edit.schema";
import { ZFindTeamMembersMatchingAttributeLogicInputSchema } from "./findTeamMembersMatchingAttributeLogic.schema";
import { getAttributeSchema } from "./get.schema";
import { getByUserIdSchema } from "./getByUserId.schema";
import { toggleActiveSchema } from "./toggleActive.schema";
export type TFindTeamMembersMatchingAttributeLogicInputSchema = z.infer<
typeof ZFindTeamMembersMatchingAttributeLogicInputSchema
>;
export const attributesRouter = router({
list: authedProcedure.query(async (opts) => {
const { default: handler } = await import("./list.handler");
return handler(opts);
}),
get: authedProcedure.input(getAttributeSchema).query(async (opts) => {
const { default: handler } = await import("./get.handler");
return handler(opts);
}),
getByUserId: authedProcedure.input(getByUserIdSchema).query(async ({ ctx, input }) => {
const { default: handler } = await import("./getByUserId.handler");
return handler({ ctx, input });
}),
// Mutations
create: authedOrgAdminProcedure.input(createAttributeSchema).mutation(async ({ ctx, input }) => {
const { default: handler } = await import("./create.handler");
return handler({ ctx, input });
}),
edit: authedOrgAdminProcedure.input(editAttributeSchema).mutation(async ({ ctx, input }) => {
const { default: handler } = await import("./edit.handler");
return handler({ ctx, input });
}),
delete: authedOrgAdminProcedure.input(deleteAttributeSchema).mutation(async ({ ctx, input }) => {
const { default: handler } = await import("./delete.handler");
return handler({ ctx, input });
}),
toggleActive: authedOrgAdminProcedure.input(toggleActiveSchema).mutation(async ({ ctx, input }) => {
const { default: handler } = await import("./toggleActive.handler");
return handler({ ctx, input });
}),
assignUserToAttribute: authedOrgAdminProcedure
.input(assignUserToAttributeSchema)
.mutation(async ({ ctx, input }) => {
const { default: handler } = await import("./assignUserToAttribute.handler");
return handler({ ctx, input });
}),
bulkAssignAttributes: authedOrgAdminProcedure
.input(bulkAssignAttributesSchema)
.mutation(async ({ ctx, input }) => {
const { default: handler } = await import("./bulkAssignAttributes.handler");
return handler({ ctx, input });
}),
findTeamMembersMatchingAttributeLogic: authedProcedure
.input(ZFindTeamMembersMatchingAttributeLogicInputSchema)
.query(async ({ ctx, input }) => {
const { default: handler } = await import("./findTeamMembersMatchingAttributeLogic.handler");
return handler({ ctx, input });
}),
});