Better UX for Custom Lists

This commit is contained in:
Rob Walsh
2026-03-02 13:45:16 -07:00
parent f45f31b49c
commit b940ad39f9
8 changed files with 649 additions and 548 deletions
+7 -1
View File
@@ -95,7 +95,13 @@ export async function POST(request: NextRequest) {
}
const body = await req.json();
const { listId, apiToken } = AddShelfSchema.parse(body);
let { listId, apiToken } = AddShelfSchema.parse(body);
// Clean up token in case user pasted "Bearer " prefix
apiToken = apiToken.trim();
if (apiToken.toLowerCase().startsWith('bearer ')) {
apiToken = apiToken.slice(7).trim();
}
// Check for duplicate
const existing = await prisma.hardcoverShelf.findUnique({