Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ MISTRAL_API_KEY=your-mistral-api-key
# Optional: MISTRAL_OCR_MODEL=mistral-ocr-latest
# Zero Sync
NEXT_PUBLIC_ZERO_SERVER=http://localhost:4848
ZERO_AUTH_SECRET=your-shared-secret-for-jwt-signing
ZERO_COOKIE_DOMAIN=.thinkex.app
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"drizzle-orm": "^0.45.2",
"gsap": "^3.14.2",
"heic2any": "^0.0.4",
"jose": "^6.2.2",
"jsonrepair": "^3.13.2",
"katex": "^0.16.45",
"lodash.throttle": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/share/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { db, workspaces } from "@/lib/db/client";
import { eq } from "drizzle-orm";
import { loadWorkspaceState } from "@/lib/workspace/state-loader";
import { loadWorkspaceState } from "@/lib/workspace/workspace-state-read";

/**
* GET /api/share/[id]
Expand Down
12 changes: 11 additions & 1 deletion src/app/api/workspaces/[id]/collaborators/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import {
import { Resend } from "resend";
import { InviteEmailTemplate } from "@/components/email/invite-email";

const resend = new Resend(process.env.RESEND_API_KEY);
function getResend() {
return process.env.RESEND_API_KEY ? new Resend(process.env.RESEND_API_KEY) : null;
}

// GET /api/workspaces/[id]/collaborators
async function handleGET(
Expand Down Expand Up @@ -195,6 +197,10 @@ async function handlePOST(
try {
const identifier = ws.slug || workspaceId;
const workspaceUrl = `https://thinkex.app/workspace/${identifier}`;
const resend = getResend();
if (!resend) {
throw new Error("RESEND_API_KEY is not configured");
}
const { data, error } = await resend.emails.send(
{
from: 'ThinkEx <hello@thinkex.app>',
Expand Down Expand Up @@ -283,6 +289,10 @@ async function handlePOST(
try {
const identifier = ws.slug || workspaceId;
const workspaceUrl = `https://thinkex.app/workspace/${identifier}?invite=${token}`;
const resend = getResend();
if (!resend) {
throw new Error("RESEND_API_KEY is not configured");
}
const { error } = await resend.emails.send(
{
from: 'ThinkEx <hello@thinkex.app>',
Expand Down
271 changes: 0 additions & 271 deletions src/app/api/workspaces/[id]/events/route.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/api/workspaces/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { db, workspaces } from "@/lib/db/client";
import { eq, and, ne } from "drizzle-orm";
import { loadWorkspaceState } from "@/lib/workspace/state-loader";
import { loadWorkspaceState } from "@/lib/workspace/workspace-state-read";
import {
requireAuth,
verifyWorkspaceOwnership,
Expand Down
28 changes: 0 additions & 28 deletions src/app/api/workspaces/[id]/state/route.ts

This file was deleted.

Loading