feat(api): allow search API in read-only mode

This commit is contained in:
yiling
2026-06-17 22:30:09 +08:00
parent d81fc275f4
commit f4276a19aa
2 changed files with 13 additions and 1 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ export const authMiddleware = createMiddleware<{
if (process.env.REVIEWER_READ_ONLY === '1') {
const method = c.req.method.toUpperCase()
if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {
const path = c.req.path
if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method) && !path.endsWith('/search')) {
const member = await prisma.teamMember.findFirst({
where: {
userId: user.id,