diff --git a/apps/mail-bridge/queue/mail-processor/worker.ts b/apps/mail-bridge/queue/mail-processor/worker.ts index 29dd8482..06fed48b 100644 --- a/apps/mail-bridge/queue/mail-processor/worker.ts +++ b/apps/mail-bridge/queue/mail-processor/worker.ts @@ -648,14 +648,14 @@ export const worker = new Worker< } }; - const orgShortCode = await db.query.orgs.findFirst({ + const orgShortcode = await db.query.orgs.findFirst({ where: eq(orgs.id, orgId), columns: { shortcode: true } }); - if (!orgShortCode) { + if (!orgShortcode) { throw new Error('No org shortcode found'); } @@ -714,7 +714,7 @@ export const worker = new Worker< cid: attachment.cid || null }, orgPublicId, - orgShortCode.shortcode + orgShortcode.shortcode ) ) ).then( @@ -922,7 +922,7 @@ type PreSignedData = { async function uploadAndAttachAttachment( input: UploadAndAttachAttachmentInput, orgPublicId: TypeId<'org'>, - orgShortCode: string + orgShortcode: string ) { const preUpload = (await fetch( `${env.STORAGE_URL}/api/attachments/internalPresign`, @@ -976,7 +976,7 @@ async function uploadAndAttachAttachment( }); return { - attachmentUrl: `${env.STORAGE_URL}/attachment/${orgShortCode}/${attachmentPublicId}/${input.fileName}`, + attachmentUrl: `${env.STORAGE_URL}/attachment/${orgShortcode}/${attachmentPublicId}/${input.fileName}`, cid: input.cid, inline: input.inline }; diff --git a/apps/platform/routes/auth.ts b/apps/platform/routes/auth.ts index 7f48a12e..1ff5ce0a 100644 --- a/apps/platform/routes/auth.ts +++ b/apps/platform/routes/auth.ts @@ -19,7 +19,7 @@ authApi.get('/status', async (c) => { authApi.get('/redirection', async (c) => { const account = c.get('account'); if (!account) { - return c.json({ defaultOrgShortCode: null }, 401); + return c.json({ defaultOrgShortcode: null }, 401); } const accountId = account.id; @@ -45,7 +45,7 @@ authApi.get('/redirection', async (c) => { } return c.json({ - defaultOrgShortCode: + defaultOrgShortcode: accountResponse?.orgMemberships[0]?.org?.shortcode || null }); }); diff --git a/apps/platform/routes/realtime.ts b/apps/platform/routes/realtime.ts index 2bd133cd..9f5c0388 100644 --- a/apps/platform/routes/realtime.ts +++ b/apps/platform/routes/realtime.ts @@ -2,7 +2,7 @@ import { Hono } from 'hono'; import type { Ctx } from '~platform/ctx'; import { zValidator } from '@hono/zod-validator'; import { z } from 'zod'; -import { validateOrgShortCode } from '~platform/utils/orgShortCode'; +import { validateOrgShortcode } from '~platform/utils/orgShortcode'; import { db } from '@u22n/database'; import { and, eq } from '@u22n/database/orm'; import { orgMembers } from '@u22n/database/schema'; @@ -16,7 +16,7 @@ realtimeApi.post( zValidator('header', z.object({ 'org-shortcode': z.string() })), async (c) => { const accountContext = c.get('account'); - const orgContext = await validateOrgShortCode( + const orgContext = await validateOrgShortcode( c.req.valid('header')['org-shortcode'] ); diff --git a/apps/platform/trpc/routers/authRouter/passwordRouter.ts b/apps/platform/trpc/routers/authRouter/passwordRouter.ts index 91589649..5bb3c953 100644 --- a/apps/platform/trpc/routers/authRouter/passwordRouter.ts +++ b/apps/platform/trpc/routers/authRouter/passwordRouter.ts @@ -131,7 +131,7 @@ export const passwordRouter = router({ .output( z.object({ status: z.enum(['NO_2FA_SETUP', '2FA_REQUIRED']), - defaultOrgShortCode: z.string().optional() + defaultOrgShortcode: z.string().optional() }) ) .mutation(async ({ ctx, input }) => { @@ -207,7 +207,7 @@ export const passwordRouter = router({ ); return { status: '2FA_REQUIRED', - defaultOrgShortCode: userResponse.orgMemberships[0]?.org.shortcode + defaultOrgShortcode: userResponse.orgMemberships[0]?.org.shortcode }; } else { await createLuciaSessionCookie(ctx.event, { @@ -217,7 +217,7 @@ export const passwordRouter = router({ }); return { status: 'NO_2FA_SETUP', - defaultOrgShortCode: userResponse.orgMemberships[0]?.org.shortcode + defaultOrgShortcode: userResponse.orgMemberships[0]?.org.shortcode }; } }), diff --git a/apps/platform/trpc/routers/orgRouter/mail/domainsRouter.ts b/apps/platform/trpc/routers/orgRouter/mail/domainsRouter.ts index d4e13437..8f2b523b 100644 --- a/apps/platform/trpc/routers/orgRouter/mail/domainsRouter.ts +++ b/apps/platform/trpc/routers/orgRouter/mail/domainsRouter.ts @@ -29,7 +29,7 @@ export const domainsRouter = router({ const iCanHazCaller = iCanHazCallerFactory(ctx); const canHazDomain = await iCanHazCaller.domain({ - orgShortCode: input.orgShortCode + orgShortcode: input.orgShortcode }); if (!canHazDomain) { throw new TRPCError({ diff --git a/apps/platform/trpc/routers/orgRouter/orgCrudRouter.ts b/apps/platform/trpc/routers/orgRouter/orgCrudRouter.ts index 98547148..84168e07 100644 --- a/apps/platform/trpc/routers/orgRouter/orgCrudRouter.ts +++ b/apps/platform/trpc/routers/orgRouter/orgCrudRouter.ts @@ -12,7 +12,7 @@ import { typeIdGenerator } from '@u22n/utils/typeid'; import { TRPCError } from '@trpc/server'; import { blockedUsernames, reservedUsernames } from '~platform/utils/signup'; -async function validateOrgShortCode( +async function validateOrgShortcode( db: DBType, shortcode: string ): Promise<{ @@ -49,7 +49,7 @@ async function validateOrgShortCode( } export const crudRouter = router({ - checkShortCodeAvailability: accountProcedure + checkShortcodeAvailability: accountProcedure .input( z.object({ shortcode: z @@ -62,14 +62,14 @@ export const crudRouter = router({ }) ) .query(async ({ ctx, input }) => { - return await validateOrgShortCode(ctx.db, input.shortcode); + return await validateOrgShortcode(ctx.db, input.shortcode); }), createNewOrg: accountProcedure .input( z.object({ orgName: z.string().min(3).max(32), - orgShortCode: z + orgShortcode: z .string() .min(5) .max(64) @@ -82,9 +82,9 @@ export const crudRouter = router({ const { db, account } = ctx; const accountId = account.id; - const shortcodeAvailability = await validateOrgShortCode( + const shortcodeAvailability = await validateOrgShortcode( db, - input.orgShortCode + input.orgShortcode ); if (!shortcodeAvailability.available) { @@ -99,7 +99,7 @@ export const crudRouter = router({ const insertOrgResponse = await db.insert(orgs).values({ ownerId: accountId, name: input.orgName, - shortcode: input.orgShortCode, + shortcode: input.orgShortcode, publicId: newPublicId }); const orgId = +insertOrgResponse.insertId; @@ -184,13 +184,13 @@ export const crudRouter = router({ } }); - const adminOrgShortCodes = orgMembersQuery + const adminOrgShortcodes = orgMembersQuery .filter((orgMember) => orgMember.role === 'admin') .map((orgMember) => orgMember.org.shortcode); return { userOrgs: orgMembersQuery, - adminOrgShortCodes: adminOrgShortCodes + adminOrgShortcodes: adminOrgShortcodes }; }) }); diff --git a/apps/platform/trpc/routers/orgRouter/orgStoreRouter.ts b/apps/platform/trpc/routers/orgRouter/orgStoreRouter.ts index 06dd4e34..5cc42fcb 100644 --- a/apps/platform/trpc/routers/orgRouter/orgStoreRouter.ts +++ b/apps/platform/trpc/routers/orgRouter/orgStoreRouter.ts @@ -53,14 +53,14 @@ export const storeRouter = router({ ({ org, profile }) => ({ name: org.name, publicId: org.publicId, - shortCode: org.shortcode, + shortcode: org.shortcode, avatarTimestamp: org.avatarTimestamp, orgMemberProfile: profile }) ); const currentOrg = orgsTransformed.find( - (o) => o.shortCode === input.orgShortCode + (o) => o.shortcode === input.orgShortcode ); if (!currentOrg) { diff --git a/apps/platform/trpc/routers/orgRouter/users/invitesRouter.ts b/apps/platform/trpc/routers/orgRouter/users/invitesRouter.ts index 5338e8c2..0b53ba9b 100644 --- a/apps/platform/trpc/routers/orgRouter/users/invitesRouter.ts +++ b/apps/platform/trpc/routers/orgRouter/users/invitesRouter.ts @@ -20,7 +20,7 @@ import { } from '@u22n/database/schema'; import { typeIdGenerator, typeIdValidator } from '@u22n/utils/typeid'; import { nanoIdToken, zodSchemas } from '@u22n/utils/zodSchemas'; -import { refreshOrgShortCodeCache } from '~platform/utils/orgShortCode'; +import { refreshOrgShortcodeCache } from '~platform/utils/orgShortcode'; import { isAccountAdminOfOrg } from '~platform/utils/account'; import { TRPCError } from '@trpc/server'; import { billingTrpcClient } from '~platform/utils/tRPCServerClients'; @@ -343,7 +343,7 @@ export const invitesRouter = router({ orgPublicId: queryInvitesResponse.org.publicId, orgAvatarTimestamp: queryInvitesResponse.org.avatarTimestamp, orgName: queryInvitesResponse.org.name, - orgShortCode: queryInvitesResponse.org.shortcode, + orgShortcode: queryInvitesResponse.org.shortcode, loggedIn: userLoggedIn, username: username }; @@ -466,11 +466,11 @@ export const invitesRouter = router({ }); } - await refreshOrgShortCodeCache(+queryInvitesResponse.orgId); + await refreshOrgShortcodeCache(+queryInvitesResponse.orgId); return { success: true, - orgShortCode: queryInvitesResponse.org.shortcode + orgShortcode: queryInvitesResponse.org.shortcode }; }), invalidateInvite: orgAdminProcedure diff --git a/apps/platform/trpc/routers/userRouter/defaultsRouter.ts b/apps/platform/trpc/routers/userRouter/defaultsRouter.ts index 63f0d1cd..fd551f01 100644 --- a/apps/platform/trpc/routers/userRouter/defaultsRouter.ts +++ b/apps/platform/trpc/routers/userRouter/defaultsRouter.ts @@ -46,7 +46,7 @@ export const defaultsRouter = router({ const userHasOrgMembership = accountResponse.orgMemberships.length > 0; return { - defaultOrgShortCode: + defaultOrgShortcode: accountResponse?.orgMemberships[0]?.org?.shortcode || null, twoFactorEnabledCorrectly: twoFactorEnabledCorrectly, userHasOrgMembership: userHasOrgMembership, diff --git a/apps/platform/trpc/routers/userRouter/profileRouter.ts b/apps/platform/trpc/routers/userRouter/profileRouter.ts index e090624e..200d693b 100644 --- a/apps/platform/trpc/routers/userRouter/profileRouter.ts +++ b/apps/platform/trpc/routers/userRouter/profileRouter.ts @@ -47,7 +47,7 @@ export const profileRouter = router({ .input( z.object({ orgPublicId: typeIdValidator('org').optional(), - orgShortCode: z.string().min(1).max(32).optional() + orgShortcode: z.string().min(1).max(32).optional() }) ) .query(async ({ ctx, input }) => { @@ -55,12 +55,12 @@ export const profileRouter = router({ const accountId = account.id; let orgId: number | null = null; - if (input.orgPublicId || input.orgShortCode) { + if (input.orgPublicId || input.orgShortcode) { const orgQuery = await db.query.orgs.findFirst({ where: input.orgPublicId ? eq(orgs.publicId, input.orgPublicId) - : input.orgShortCode - ? eq(orgs.shortcode, input.orgShortCode) + : input.orgShortcode + ? eq(orgs.shortcode, input.orgShortcode) : eq(orgs.id, 0), columns: { id: true @@ -68,7 +68,7 @@ export const profileRouter = router({ }); orgId = orgQuery?.id || null; } - if ((input.orgPublicId || input.orgShortCode) && !orgId) { + if ((input.orgPublicId || input.orgShortcode) && !orgId) { throw new TRPCError({ code: 'NOT_FOUND', message: diff --git a/apps/platform/trpc/trpc.ts b/apps/platform/trpc/trpc.ts index 063e777e..9205c5fd 100644 --- a/apps/platform/trpc/trpc.ts +++ b/apps/platform/trpc/trpc.ts @@ -1,6 +1,6 @@ import { TRPCError, initTRPC } from '@trpc/server'; import superjson from 'superjson'; -import { validateOrgShortCode } from '~platform/utils/orgShortCode'; +import { validateOrgShortcode } from '~platform/utils/orgShortcode'; import type { TrpcContext } from '~platform/ctx'; import { z } from 'zod'; import { env } from '~platform/env'; @@ -53,14 +53,14 @@ export const accountProcedure = publicProcedure.use(isAccountAuthenticated); export const orgProcedure = publicProcedure .use(isAccountAuthenticated) - .input(z.object({ orgShortCode: z.string() })) + .input(z.object({ orgShortcode: z.string() })) .use(({ input, ctx, next }) => ctx.event .get('otel') - .tracer.startActiveSpan(`Validate orgShortCode`, async (span) => { - const { orgShortCode } = input; - span.setAttribute('org.shortCode', orgShortCode); - const orgData = await validateOrgShortCode(orgShortCode); + .tracer.startActiveSpan(`Validate orgShortcode`, async (span) => { + const { orgShortcode } = input; + span.setAttribute('org.shortcode', orgShortcode); + const orgData = await validateOrgShortcode(orgShortcode); if (!orgData) { span.setAttributes({ 'org.found': false }); diff --git a/apps/platform/utils/orgShortCode.ts b/apps/platform/utils/orgShortcode.ts similarity index 76% rename from apps/platform/utils/orgShortCode.ts rename to apps/platform/utils/orgShortcode.ts index d7612293..d34f3b09 100644 --- a/apps/platform/utils/orgShortCode.ts +++ b/apps/platform/utils/orgShortcode.ts @@ -4,17 +4,17 @@ import { orgs } from '@u22n/database/schema'; import type { OrgContext } from '~platform/ctx'; import { storage } from '~platform/storage'; -export async function validateOrgShortCode(orgShortCode: string) { - if (!orgShortCode) return null; +export async function validateOrgShortcode(orgShortcode: string) { + if (!orgShortcode) return null; - const cachedShortCodeOrgContext = - await storage.orgContext.getItem(orgShortCode); - if (cachedShortCodeOrgContext) { - return cachedShortCodeOrgContext; + const cachedShortcodeOrgContext = + await storage.orgContext.getItem(orgShortcode); + if (cachedShortcodeOrgContext) { + return cachedShortcodeOrgContext; } const orgLookupResult = await db.query.orgs.findFirst({ - where: eq(orgs.shortcode, orgShortCode), + where: eq(orgs.shortcode, orgShortcode), columns: { id: true, publicId: true, name: true }, with: { members: { @@ -38,11 +38,11 @@ export async function validateOrgShortCode(orgShortCode: string) { name: orgLookupResult.name }; - await storage.orgContext.setItem(orgShortCode, orgContext); + await storage.orgContext.setItem(orgShortcode, orgContext); return orgContext; } -export async function refreshOrgShortCodeCache(orgId: number) { +export async function refreshOrgShortcodeCache(orgId: number) { const orgLookupResult = await db.query.orgs.findFirst({ where: eq(orgs.id, orgId), columns: { id: true, publicId: true, shortcode: true, name: true }, diff --git a/apps/storage/api/presign.ts b/apps/storage/api/presign.ts index f6c83552..8745c1e2 100644 --- a/apps/storage/api/presign.ts +++ b/apps/storage/api/presign.ts @@ -17,14 +17,14 @@ export const presignApi = new Hono().get( checkSignedIn, zValidator( 'query', - z.object({ filename: z.string(), orgShortCode: z.string() }) + z.object({ filename: z.string(), orgShortcode: z.string() }) ), async (c) => { const accountId = c.get('account')?.id!; // we know it's not null here, checked in the middleware const data = c.req.valid('query'); const orgQueryResponse = await db.query.orgs.findFirst({ - where: eq(orgs.shortcode, data.orgShortCode), + where: eq(orgs.shortcode, data.orgShortcode), columns: { id: true, publicId: true diff --git a/apps/storage/proxy/attachment.ts b/apps/storage/proxy/attachment.ts index 3bae7f7e..60b46d5e 100644 --- a/apps/storage/proxy/attachment.ts +++ b/apps/storage/proxy/attachment.ts @@ -12,17 +12,17 @@ import { convoAttachments, orgMembers, orgs } from '@u22n/database/schema'; import type { Ctx } from '../ctx'; export const attachmentProxy = new Hono().get( - '/:orgShortCode/:attachmentId/:filename', + '/:orgShortcode/:attachmentId/:filename', zValidator( 'param', z.object({ filename: z.string().transform((f) => decodeURIComponent(f)), attachmentId: typeIdValidator('convoAttachments'), - orgShortCode: z.string() + orgShortcode: z.string() }) ), async (c) => { - const { filename, attachmentId, orgShortCode } = c.req.valid('param'); + const { filename, attachmentId, orgShortcode } = c.req.valid('param'); const attachmentQueryResponse = await db.query.convoAttachments.findFirst({ where: eq(convoAttachments.publicId, attachmentId), @@ -44,7 +44,7 @@ export const attachmentProxy = new Hono().get( } const orgQueryResponse = await db.query.orgs.findFirst({ - where: eq(orgs.shortcode, orgShortCode), + where: eq(orgs.shortcode, orgShortcode), columns: { id: true, publicId: true diff --git a/apps/web/src/app/(login)/login/page.tsx b/apps/web/src/app/(login)/login/page.tsx index 013b82ff..26d72593 100644 --- a/apps/web/src/app/(login)/login/page.tsx +++ b/apps/web/src/app/(login)/login/page.tsx @@ -65,13 +65,13 @@ export default function Page() { const handleLogin = async (values: z.infer) => { try { - const { status, defaultOrgShortCode } = await login(values); + const { status, defaultOrgShortcode } = await login(values); if (status === 'NO_2FA_SETUP') { - if (!defaultOrgShortCode) { + if (!defaultOrgShortcode) { router.push('/join/org'); } else { router.push( - `/${defaultOrgShortCode}/settings/user/security?code=NO_2FA_SETUP` + `/${defaultOrgShortcode}/settings/user/security?code=NO_2FA_SETUP` ); } } else { diff --git a/apps/web/src/app/[orgShortCode]/_components/atoms.ts b/apps/web/src/app/[orgShortcode]/_components/atoms.ts similarity index 100% rename from apps/web/src/app/[orgShortCode]/_components/atoms.ts rename to apps/web/src/app/[orgShortcode]/_components/atoms.ts diff --git a/apps/web/src/app/[orgShortCode]/_components/claim-email-identity.tsx b/apps/web/src/app/[orgShortcode]/_components/claim-email-identity.tsx similarity index 90% rename from apps/web/src/app/[orgShortCode]/_components/claim-email-identity.tsx rename to apps/web/src/app/[orgShortcode]/_components/claim-email-identity.tsx index 75828542..48e352be 100644 --- a/apps/web/src/app/[orgShortCode]/_components/claim-email-identity.tsx +++ b/apps/web/src/app/[orgShortcode]/_components/claim-email-identity.tsx @@ -11,7 +11,7 @@ import { useGlobalStore } from '@/src/providers/global-store-provider'; import Link from 'next/link'; export function ClaimEmailIdentity() { - const orgShortCode = useGlobalStore((state) => state.currentOrg.shortCode); + const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode); return ( // This dialog should be opened when it is mounted @@ -37,7 +37,7 @@ export function ClaimEmailIdentity() { diff --git a/apps/web/src/app/[orgShortCode]/_components/sidebar-content.tsx b/apps/web/src/app/[orgShortcode]/_components/sidebar-content.tsx similarity index 97% rename from apps/web/src/app/[orgShortCode]/_components/sidebar-content.tsx rename to apps/web/src/app/[orgShortcode]/_components/sidebar-content.tsx index b944481f..9ccef809 100644 --- a/apps/web/src/app/[orgShortCode]/_components/sidebar-content.tsx +++ b/apps/web/src/app/[orgShortcode]/_components/sidebar-content.tsx @@ -55,7 +55,7 @@ import { import { env } from '@/src/env'; export default function SidebarContent() { - const orgShortCode = useGlobalStore((state) => state.currentOrg.shortCode); + const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode); return (
+ href={`/${orgShortcode}/convo`}>
{ - setCurrentOrg(org.shortCode); - router.push(`/${org.shortCode}/convo`); + setCurrentOrg(org.shortcode); + router.push(`/${org.shortcode}/convo`); }} className={ 'flex w-full cursor-pointer flex-row items-center justify-between gap-2' @@ -246,7 +246,7 @@ function OrgMenu() { {org.name}
- {org.shortCode === currentOrg.shortCode && } + {org.shortcode === currentOrg.shortcode && }
))} @@ -282,7 +282,7 @@ function OrgMenu() { Settings diff --git a/apps/web/src/app/[orgShortCode]/_components/sidebar-nav-button.tsx b/apps/web/src/app/[orgShortcode]/_components/sidebar-nav-button.tsx similarity index 100% rename from apps/web/src/app/[orgShortCode]/_components/sidebar-nav-button.tsx rename to apps/web/src/app/[orgShortcode]/_components/sidebar-nav-button.tsx diff --git a/apps/web/src/app/[orgShortCode]/_components/sidebar.tsx b/apps/web/src/app/[orgShortcode]/_components/sidebar.tsx similarity index 100% rename from apps/web/src/app/[orgShortCode]/_components/sidebar.tsx rename to apps/web/src/app/[orgShortcode]/_components/sidebar.tsx diff --git a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/context-panel.tsx b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/context-panel.tsx similarity index 100% rename from apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/context-panel.tsx rename to apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/context-panel.tsx diff --git a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/convo-views.tsx b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/convo-views.tsx similarity index 91% rename from apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/convo-views.tsx rename to apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/convo-views.tsx index 7f7b4ccb..6bb576dc 100644 --- a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/convo-views.tsx +++ b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/convo-views.tsx @@ -12,13 +12,13 @@ import { env } from '@/src/env'; import { usePageTitle } from '@/src/hooks/use-page-title'; export function ConvoView({ convoId }: { convoId: TypeId<'convos'> }) { - const orgShortCode = useGlobalStore((state) => state.currentOrg.shortCode); + const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode); const { data: convoData, isLoading: convoDataLoading, error: convoError } = platform.convos.getConvo.useQuery({ - orgShortCode, + orgShortcode, convoPublicId: convoId }); @@ -30,11 +30,11 @@ export function ConvoView({ convoId }: { convoId: TypeId<'convos'> }) { .filter((f) => !f.inline) .map((attachment) => ({ name: attachment.fileName, - url: `${env.NEXT_PUBLIC_STORAGE_URL}/attachment/${orgShortCode}/${attachment.publicId}/${attachment.fileName}`, + url: `${env.NEXT_PUBLIC_STORAGE_URL}/attachment/${orgShortcode}/${attachment.publicId}/${attachment.fileName}`, type: attachment.type, publicId: attachment.publicId })); - }, [convoData, orgShortCode]); + }, [convoData, orgShortcode]); const participantOwnPublicId = convoData?.ownParticipantPublicId; const convoHidden = useMemo( @@ -94,7 +94,7 @@ export function ConvoView({ convoId }: { convoId: TypeId<'convos'> }) { } export function ConvoNotFound() { - const orgShortCode = useGlobalStore((state) => state.currentOrg.shortCode); + const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode); usePageTitle('Convo Not Found'); return ( @@ -105,7 +105,7 @@ export function ConvoNotFound() { The convo you are looking for does not exist. Please check the URL and try again. - +
diff --git a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/messages-panel.tsx b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/messages-panel.tsx similarity index 99% rename from apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/messages-panel.tsx rename to apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/messages-panel.tsx index ea59a22b..0465ea17 100644 --- a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/messages-panel.tsx +++ b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/messages-panel.tsx @@ -40,7 +40,7 @@ export function MessagesPanel({ ReturnType >[]; }) { - const orgShortCode = useGlobalStore((state) => state.currentOrg.shortCode); + const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode); // This is the index of the first item in the list. It is set to a high number to ensure that the list starts at the bottom // This also means the list can't be longer than 10000 items (which is fine for our most cases) const INVERSE_LIST_START_INDEX = 10000; @@ -53,7 +53,7 @@ export function MessagesPanel({ platform.convos.entries.getConvoEntries.useInfiniteQuery( { convoPublicId: convoId, - orgShortCode + orgShortcode }, { getNextPageParam: (lastPage) => lastPage.cursor ?? undefined, diff --git a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/original-message-view.tsx b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/original-message-view.tsx similarity index 96% rename from apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/original-message-view.tsx rename to apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/original-message-view.tsx index 8f13134e..10ba86cf 100644 --- a/apps/web/src/app/[orgShortCode]/convo/[convoId]/_components/original-message-view.tsx +++ b/apps/web/src/app/[orgShortcode]/convo/[convoId]/_components/original-message-view.tsx @@ -14,10 +14,11 @@ export function OriginalMessageView({ setOpen: (open: boolean) => void; messagePublicId: TypeId<'convoEntries'>; }) { - const orgShortCode = useGlobalStore((state) => state.currentOrg.shortCode); + const orgShortcode = useGlobalStore((state) => state.currentOrg.shortcode); + const { data, isLoading, error } = platform.convos.entries.getConvoSingleEntryRawEmail.useQuery({ - orgShortCode, + orgShortcode: orgShortcode, convoEntryPublicId: messagePublicId }); @@ -98,6 +99,7 @@ const OriginalMessageIframe = memo( return (