File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
apps/sim/app/api/workflows/[id]/duplicate Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
9393 )
9494 return NextResponse . json ( { error : 'Access denied' } , { status : 403 } )
9595 }
96+
97+ if ( error . message === 'Write or admin access required for target workspace' ) {
98+ logger . warn (
99+ `[${ requestId } ] User ${ userId } lacks write access to target workspace`
100+ )
101+ return NextResponse . json ( { error : 'Write or admin access required' } , { status : 403 } )
102+ }
103+
104+ if ( error . message . includes ( 'not attached to a workspace' ) ) {
105+ logger . warn ( `[${ requestId } ] Workflow not attached to a workspace` )
106+ return NextResponse . json ( { error : error . message } , { status : 400 } )
107+ }
108+
109+ if ( error . message === 'Workspace ID is required' ) {
110+ logger . warn ( `[${ requestId } ] Missing workspace ID in duplication request` )
111+ return NextResponse . json ( { error : 'Workspace ID is required' } , { status : 400 } )
112+ }
96113 }
97114
98115 if ( error instanceof z . ZodError ) {
You can’t perform that action at this time.
0 commit comments