Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/api/chat/[graph]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { NextRequest, NextResponse } from "next/server"
import { getEnvVariables } from "../../utils"


export async function POST(request: NextRequest, { params }: { params: { graph: string } }) {
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = params.graph
const repo = (await params).graph
const msg = request.nextUrl.searchParams.get('msg')

try {
Expand Down
8 changes: 5 additions & 3 deletions app/api/repo/[graph]/[node]/route.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { getEnvVariables } from "@/app/api/utils";
import { NextRequest, NextResponse } from "next/server";

export async function POST(request: NextRequest, { params }: { params: { graph: string, node: string } }) {
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string, node: string }> }) {

const repo = params.graph;
const src = Number(params.node);
const p = await params;

const repo = p.graph;
const src = Number(p.node);
const dest = Number(request.nextUrl.searchParams.get('targetId'))

try {
Expand Down
8 changes: 4 additions & 4 deletions app/api/repo/[graph]/commit/route.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getEnvVariables } from "@/app/api/utils";
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest, { params }: { params: { graph: string } }) {
export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = (await params).graph

const repo = params.graph

try {

const { url, token } = getEnvVariables()
Expand Down Expand Up @@ -32,6 +32,6 @@ export async function GET(request: NextRequest, { params }: { params: { graph: s
}
}

export async function POST(request: NextRequest, { params }: { params: { graph: string } }) {
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

}
6 changes: 3 additions & 3 deletions app/api/repo/[graph]/info/route.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NextRequest, NextResponse } from "next/server";
import { getEnvVariables } from "@/app/api/utils";

export async function GET(request: NextRequest, { params }: { params: { graph: string } }) {
export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = params.graph
const repo = (await params).graph

try {

const { url, token } = getEnvVariables();

const result = await fetch(`${url}/repo_info`, {
Expand Down
6 changes: 3 additions & 3 deletions app/api/repo/[graph]/neighbors/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NextRequest, NextResponse } from "next/server";
import { getEnvVariables } from "@/app/api/utils";

export async function POST(request: NextRequest, { params }: { params: { graph: string } }) {
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = params.graph;
const repo = (await params).graph;
const node_ids = (await request.json()).nodeIds.map((id: string) => Number(id));

try {
Expand All @@ -13,7 +13,7 @@ export async function POST(request: NextRequest, { params }: { params: { graph:
if (node_ids.length === 0) {
throw new Error("nodeIds is required");
}

const result = await fetch(`${url}/get_neighbors`, {
method: 'POST',
body: JSON.stringify({ node_ids, repo }),
Expand Down
8 changes: 4 additions & 4 deletions app/api/repo/[graph]/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NextRequest, NextResponse } from "next/server"
import { getEnvVariables } from "../../utils"

export async function GET(request: NextRequest, { params }: { params: { graph: string } }) {
export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const graphName = params.graph
const graphName = (await params).graph

try {

Expand All @@ -29,9 +29,9 @@ export async function GET(request: NextRequest, { params }: { params: { graph: s
}
}

export async function POST(request: NextRequest, { params }: { params: { graph: string } }) {
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = params.graph
const repo = (await params).graph
const prefix = request.nextUrl.searchParams.get('prefix')

try {
Expand Down
Loading
Loading