mirror of
https://github.com/documenso/documenso.git
synced 2025-11-25 22:21:31 +10:00
fix: wip
This commit is contained in:
@ -2,6 +2,7 @@ import { Trans } from '@lingui/macro';
|
||||
import { DocumentStatus, SigningStatus } from '@prisma/client';
|
||||
import { Clock8 } from 'lucide-react';
|
||||
import { Link, redirect } from 'react-router';
|
||||
import { getOptionalLoaderSession } from 'server/utils/get-loader-session';
|
||||
|
||||
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||
import { useOptionalSession } from '@documenso/lib/client-only/providers/session';
|
||||
@ -25,14 +26,16 @@ import { superLoaderJson, useSuperLoaderData } from '~/utils/super-json-loader';
|
||||
|
||||
import type { Route } from './+types/_index';
|
||||
|
||||
export async function loader({ params, context }: Route.LoaderArgs) {
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const session = getOptionalLoaderSession();
|
||||
|
||||
const { token } = params;
|
||||
|
||||
if (!token) {
|
||||
throw new Response('Not Found', { status: 404 });
|
||||
}
|
||||
|
||||
const user = context.session?.user;
|
||||
const user = session?.user;
|
||||
|
||||
const [document, fields, recipient, completedFields] = await Promise.all([
|
||||
getDocumentAndSenderByToken({
|
||||
|
||||
@ -3,6 +3,7 @@ import { useLingui } from '@lingui/react';
|
||||
import { DocumentStatus, FieldType, RecipientRole } from '@prisma/client';
|
||||
import { CheckCircle2, Clock8, FileSearch } from 'lucide-react';
|
||||
import { Link } from 'react-router';
|
||||
import { getOptionalLoaderSession } from 'server/utils/get-loader-session';
|
||||
import { match } from 'ts-pattern';
|
||||
|
||||
import signingCelebration from '@documenso/assets/images/signing-celebration.png';
|
||||
@ -27,14 +28,16 @@ import { DocumentSigningAuthPageView } from '~/components/general/document-signi
|
||||
|
||||
import type { Route } from './+types/complete';
|
||||
|
||||
export async function loader({ params, context }: Route.LoaderArgs) {
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const session = getOptionalLoaderSession();
|
||||
|
||||
const { token } = params;
|
||||
|
||||
if (!token) {
|
||||
throw new Response('Not Found', { status: 404 });
|
||||
}
|
||||
|
||||
const user = context.session?.user;
|
||||
const user = session?.user;
|
||||
|
||||
const document = await getDocumentAndSenderByToken({
|
||||
token,
|
||||
|
||||
@ -2,6 +2,7 @@ import { Trans } from '@lingui/macro';
|
||||
import { FieldType } from '@prisma/client';
|
||||
import { XCircle } from 'lucide-react';
|
||||
import { Link } from 'react-router';
|
||||
import { getOptionalLoaderSession } from 'server/utils/get-loader-session';
|
||||
|
||||
import { useOptionalSession } from '@documenso/lib/client-only/providers/session';
|
||||
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
|
||||
@ -16,14 +17,16 @@ import { truncateTitle } from '~/utils/truncate-title';
|
||||
|
||||
import type { Route } from './+types/rejected';
|
||||
|
||||
export async function loader({ params, context }: Route.LoaderArgs) {
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const session = getOptionalLoaderSession();
|
||||
|
||||
const { token } = params;
|
||||
|
||||
if (!token) {
|
||||
throw new Response('Not Found', { status: 404 });
|
||||
}
|
||||
|
||||
const user = context.session?.user;
|
||||
const user = session?.user;
|
||||
|
||||
const document = await getDocumentAndSenderByToken({
|
||||
token,
|
||||
|
||||
@ -2,6 +2,7 @@ import { Trans } from '@lingui/macro';
|
||||
import type { Team } from '@prisma/client';
|
||||
import { DocumentStatus } from '@prisma/client';
|
||||
import { Link, redirect } from 'react-router';
|
||||
import { getOptionalLoaderSession } from 'server/utils/get-loader-session';
|
||||
|
||||
import { getDocumentById } from '@documenso/lib/server-only/document/get-document-by-id';
|
||||
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
|
||||
@ -12,7 +13,9 @@ import { Button } from '@documenso/ui/primitives/button';
|
||||
|
||||
import type { Route } from './+types/waiting';
|
||||
|
||||
export async function loader({ params, context }: Route.LoaderArgs) {
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const session = getOptionalLoaderSession();
|
||||
|
||||
const { token } = params;
|
||||
|
||||
if (!token) {
|
||||
@ -34,7 +37,7 @@ export async function loader({ params, context }: Route.LoaderArgs) {
|
||||
|
||||
let isOwnerOrTeamMember = false;
|
||||
|
||||
const user = context.session?.user;
|
||||
const user = session?.user;
|
||||
let team: Team | null = null;
|
||||
|
||||
if (user) {
|
||||
|
||||
Reference in New Issue
Block a user