Revert "improvement(sync): added backwards sync from db"

This reverts commit 6125b2f0b5.
This commit is contained in:
Emir Karabeg
2025-02-28 17:34:37 -08:00
parent 6125b2f0b5
commit 7774b720f3
6 changed files with 4 additions and 156 deletions
-28
View File
@@ -1,28 +0,0 @@
import { NextResponse } from 'next/server'
import { eq } from 'drizzle-orm'
import { getSession } from '@/lib/auth'
import { db } from '@/db'
import { workflow } from '@/db/schema'
export async function GET(request: Request) {
try {
const session = await getSession()
if (!session?.user?.id) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
}
// Fetch all workflows for the current user
const userWorkflows = await db
.select()
.from(workflow)
.where(eq(workflow.userId, session.user.id))
return NextResponse.json({
success: true,
workflows: userWorkflows,
})
} catch (error) {
console.error('Fetch workflows error:', error)
return NextResponse.json({ error: 'Failed to fetch workflows' }, { status: 500 })
}
}
-23
View File
@@ -81,26 +81,3 @@ export async function POST(request: Request) {
return NextResponse.json({ error: 'Batch sync failed' }, { status: 500 })
}
}
export async function GET(request: Request) {
try {
const session = await getSession()
if (!session?.user?.id) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
}
// Fetch all workflows for the current user
const userWorkflows = await db
.select()
.from(workflow)
.where(eq(workflow.userId, session.user.id))
return NextResponse.json({
success: true,
workflows: userWorkflows,
})
} catch (error) {
console.error('Fetch workflows error:', error)
return NextResponse.json({ error: 'Failed to fetch workflows' }, { status: 500 })
}
}