mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-22 11:29:22 -05:00
fix: sets apps/web TS strict check to true (#7451)
This commit is contained in:
@@ -7,7 +7,6 @@ import { ZUserEmail, ZUserName } from "@formbricks/types/user";
|
||||
import { INVITE_DISABLED } from "@/lib/constants";
|
||||
import { authenticatedActionClient } from "@/lib/utils/action-client";
|
||||
import { checkAuthorizationUpdated } from "@/lib/utils/action-client/action-client-middleware";
|
||||
import { AuthenticatedActionClientCtx } from "@/lib/utils/action-client/types/context";
|
||||
import { withAuditLogging } from "@/modules/ee/audit-logs/lib/handler";
|
||||
import { sendInviteMemberEmail } from "@/modules/email";
|
||||
import { inviteUser } from "@/modules/setup/organization/[organizationId]/invite/lib/invite";
|
||||
@@ -21,52 +20,42 @@ const ZInviteOrganizationMemberAction = z.object({
|
||||
export const inviteOrganizationMemberAction = authenticatedActionClient
|
||||
.inputSchema(ZInviteOrganizationMemberAction)
|
||||
.action(
|
||||
withAuditLogging(
|
||||
"created",
|
||||
"invite",
|
||||
async ({
|
||||
ctx,
|
||||
parsedInput,
|
||||
}: {
|
||||
ctx: AuthenticatedActionClientCtx;
|
||||
parsedInput: Record<string, any>;
|
||||
}) => {
|
||||
if (INVITE_DISABLED) {
|
||||
throw new AuthenticationError("Invite disabled");
|
||||
}
|
||||
withAuditLogging("created", "invite", async ({ ctx, parsedInput }) => {
|
||||
if (INVITE_DISABLED) {
|
||||
throw new AuthenticationError("Invite disabled");
|
||||
}
|
||||
|
||||
await checkAuthorizationUpdated({
|
||||
userId: ctx.user.id,
|
||||
organizationId: parsedInput.organizationId,
|
||||
access: [
|
||||
{
|
||||
type: "organization",
|
||||
roles: ["owner", "manager"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
ctx.auditLoggingCtx.organizationId = parsedInput.organizationId;
|
||||
|
||||
const invitedUserId = await inviteUser({
|
||||
organizationId: parsedInput.organizationId,
|
||||
invitee: {
|
||||
email: parsedInput.email,
|
||||
name: parsedInput.name,
|
||||
await checkAuthorizationUpdated({
|
||||
userId: ctx.user.id,
|
||||
organizationId: parsedInput.organizationId,
|
||||
access: [
|
||||
{
|
||||
type: "organization",
|
||||
roles: ["owner", "manager"],
|
||||
},
|
||||
currentUserId: ctx.user.id,
|
||||
});
|
||||
],
|
||||
});
|
||||
|
||||
await sendInviteMemberEmail(invitedUserId, parsedInput.email, ctx.user.name, "");
|
||||
ctx.auditLoggingCtx.organizationId = parsedInput.organizationId;
|
||||
|
||||
ctx.auditLoggingCtx.inviteId = invitedUserId;
|
||||
ctx.auditLoggingCtx.newObject = {
|
||||
invitedUserId,
|
||||
const invitedUserId = await inviteUser({
|
||||
organizationId: parsedInput.organizationId,
|
||||
invitee: {
|
||||
email: parsedInput.email,
|
||||
name: parsedInput.name,
|
||||
};
|
||||
},
|
||||
currentUserId: ctx.user.id,
|
||||
});
|
||||
|
||||
return invitedUserId;
|
||||
}
|
||||
)
|
||||
await sendInviteMemberEmail(invitedUserId, parsedInput.email, ctx.user.name, "");
|
||||
|
||||
ctx.auditLoggingCtx.inviteId = invitedUserId;
|
||||
ctx.auditLoggingCtx.newObject = {
|
||||
invitedUserId,
|
||||
email: parsedInput.email,
|
||||
name: parsedInput.name,
|
||||
};
|
||||
|
||||
return invitedUserId;
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user