mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 12:28:44 +00:00
feat(api): allow search API in read-only mode
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user