(request: Request)
| 115 | } |
| 116 | |
| 117 | export async function DELETE(request: Request) { |
| 118 | try { |
| 119 | const { searchParams } = new URL(request.url) |
| 120 | const id = searchParams.get('id') |
| 121 | |
| 122 | const error = validateId(id) |
| 123 | if (error) return error |
| 124 | |
| 125 | const result = await executeQuery( |
| 126 | 'MATCH (n) WHERE id(n) = $NODE_ID DETACH DELETE n', |
| 127 | { NODE_ID: id } |
| 128 | ) |
| 129 | |
| 130 | return NextResponse.json(result) |
| 131 | } catch (error) { |
| 132 | return handleError(error, 'DELETE') |
| 133 | } |
| 134 | } |
nothing calls this directly
no test coverage detected