Skip to content

Commit

Permalink
update route handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhi-wa committed Jan 13, 2025
1 parent 265ec17 commit 93d9ef3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions frontend/app/api/projects/[projectId]/spans/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ export async function GET(req: NextRequest, props: { params: Promise<{ projectId


export async function DELETE(
req: Request,
{ params }: { params: { projectId: string, spanId: string } }
req: NextRequest,
props: { params: Promise<{ projectId: string; spanId: string }> }
): Promise<Response> {
const params = await props.params;
const projectId = params.projectId;

const { searchParams } = new URL(req.url);
Expand All @@ -151,8 +152,11 @@ export async function DELETE(
eq(spans.projectId, projectId)
)
);

return new Response('Spans deleted successfully', { status: 200 });
} catch (error) {
return new Response('Error deleting spans', { status: 500 });
}
}


5 changes: 3 additions & 2 deletions frontend/app/api/projects/[projectId]/traces/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ export async function GET(req: NextRequest, props: { params: Promise<{ projectId


export async function DELETE(
req: Request,
{ params }: { params: { projectId: string , traceId: string} }
req: NextRequest,
props: { params: Promise<{ projectId: string; traceId: string }> }
): Promise<Response> {
const params = await props.params;
const projectId = params.projectId;

const { searchParams } = new URL(req.url);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/dataset/dataset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default function Dataset({ dataset }: DatasetProps) {
<DeleteSelectedRows
selectedRowIds={selectedRowIds}
onDelete={handleDeleteDatapoints}
entityName="Datapoints"
entityName="datapoints"
/>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/datasets/datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function Datasets() {
<DeleteSelectedRows
selectedRowIds={selectedRowIds}
onDelete={handleDeleteDatasets}
entityName="Datasets"
entityName="datasets"
/>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/evaluations/evaluations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function Evaluations() {
<DeleteSelectedRows
selectedRowIds={selectedRowIds}
onDelete={handleDeleteEvaluations}
entityName="Evaluations"
entityName="evaluations"
/>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/traces/spans-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export default function SpansTable({ onRowClick }: SpansTableProps) {
<DeleteSelectedRows
selectedRowIds={selectedRowIds}
onDelete={handleDeleteSpans}
entityName="Spans"
entityName="spans"
/>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/traces/traces-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export default function TracesTable({ onRowClick }: TracesTableProps) {
<DeleteSelectedRows
selectedRowIds={selectedRowIds}
onDelete={handleDeleteTraces}
entityName="Traces"
entityName="traces"
/>
</div>
)}
Expand Down

0 comments on commit 93d9ef3

Please sign in to comment.