@devries-cameron20 / t3code Mirror · read-only / commits / a356cd0d0f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 11:00 UTC

Remove unused attachment route path helpers

- delete route-to-path conversion helpers from `attachmentPaths` - remove unused `attachmentRoutePath` export and route prefix import

Julius Marminge committed Mar 1, 2026 at 19:49 UTC a356cd0d0f4e1908d8acf22438b9ba0d8be9ed81
2 files changed -27
apps/server/src/attachmentPaths.ts
-22
@@ -10,14 +10,6 @@ export function normalizeAttachmentRelativePath(rawRelativePath: string): string
10 return normalized.replace(/\\/g, "/");
11 }
12
13 -export function attachmentRouteToRelativePath(dataUrl: string): string | null {
14 - const prefix = `${ATTACHMENTS_ROUTE_PREFIX}/`;
15 - if (!dataUrl.startsWith(prefix)) {
16 - return null;
17 - }
18 - return normalizeAttachmentRelativePath(dataUrl.slice(prefix.length));
19 -}
20 -
13 export function resolveAttachmentRelativePath(input: {
14 readonly stateDir: string;
15 readonly relativePath: string;
@@ -34,17 +26,3 @@ export function resolveAttachmentRelativePath(input: {
26 }
27 return filePath;
28 }
37 -
38 -export function resolveAttachmentRoutePath(input: {
39 - readonly stateDir: string;
40 - readonly dataUrl: string;
41 -}): string | null {
42 - const relativePath = attachmentRouteToRelativePath(input.dataUrl);
43 - if (!relativePath) {
44 - return null;
45 - }
46 - return resolveAttachmentRelativePath({
47 - stateDir: input.stateDir,
48 - relativePath,
49 - });
50 -}
apps/server/src/attachmentStore.ts
-5
@@ -4,7 +4,6 @@ import { existsSync } from "node:fs";
4 import type { ChatAttachment } from "@t3tools/contracts";
5
6 import {
7 - ATTACHMENTS_ROUTE_PREFIX,
7 normalizeAttachmentRelativePath,
8 resolveAttachmentRelativePath,
9 } from "./attachmentPaths.ts";
@@ -77,10 +76,6 @@ export function resolveAttachmentPath(input: {
76 });
77 }
78
80 -export function attachmentRoutePath(attachment: ChatAttachment): string {
81 - return `${ATTACHMENTS_ROUTE_PREFIX}/${encodeURIComponent(attachment.id)}`;
82 -}
83 -
79 export function resolveAttachmentPathById(input: {
80 readonly stateDir: string;
81 readonly attachmentId: string;