Fix all remaining TypeScript build errors
All checks were successful
Build and Push Docker Images / docker (push) Successful in 2m28s
All checks were successful
Build and Push Docker Images / docker (push) Successful in 2m28s
- Import and use OffsetOrderSource type in wrenClient.ts - Fix Recharts PieChart label rendering with proper props - Remove unused POST body parameter in orders route All TypeScript errors now resolved, build succeeds.
This commit is contained in:
parent
10b277b853
commit
7751976fc9
@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { DollarSign, Package, Leaf, TrendingUp, Calendar, Loader2 } from 'lucide-react';
|
||||
import { DollarSign, Package, Leaf, TrendingUp, Loader2 } from 'lucide-react';
|
||||
import {
|
||||
LineChart,
|
||||
Line,
|
||||
@ -254,7 +254,25 @@ export default function AdminDashboard() {
|
||||
cx="50%"
|
||||
cy="50%"
|
||||
labelLine={false}
|
||||
label={({ name, percent }) => `${name}: ${(percent * 100).toFixed(0)}%`}
|
||||
label={(props: any) => {
|
||||
const RADIAN = Math.PI / 180;
|
||||
const { cx, cy, midAngle, innerRadius, outerRadius, percent, name } = props;
|
||||
const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
|
||||
const x = cx + radius * Math.cos(-midAngle * RADIAN);
|
||||
const y = cy + radius * Math.sin(-midAngle * RADIAN);
|
||||
|
||||
return (
|
||||
<text
|
||||
x={x}
|
||||
y={y}
|
||||
fill="white"
|
||||
textAnchor={x > cx ? 'start' : 'end'}
|
||||
dominantBaseline="central"
|
||||
>
|
||||
{`${name}: ${(percent * 100).toFixed(0)}%`}
|
||||
</text>
|
||||
);
|
||||
}}
|
||||
outerRadius={80}
|
||||
fill="#8884d8"
|
||||
dataKey="value"
|
||||
|
||||
@ -6,7 +6,7 @@ import { nocodbClient } from '@/api/nocodbClient';
|
||||
* Get single order by record ID
|
||||
*/
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
_request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
@ -63,7 +63,7 @@ export async function PATCH(
|
||||
* Delete/archive an order
|
||||
*/
|
||||
export async function DELETE(
|
||||
request: NextRequest,
|
||||
_request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
|
||||
@ -61,10 +61,8 @@ export async function GET(request: NextRequest) {
|
||||
* POST /api/admin/orders
|
||||
* Create a new order (if needed for manual entry)
|
||||
*/
|
||||
export async function POST(request: NextRequest) {
|
||||
export async function POST(_request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
// In a real implementation, you'd call nocodbClient to create the order
|
||||
// For now, return a placeholder
|
||||
return NextResponse.json(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import type { OffsetOrder, Portfolio } from '../types';
|
||||
import type { OffsetOrder, OffsetOrderSource, Portfolio } from '../types';
|
||||
import { logger } from '../utils/logger';
|
||||
|
||||
// Default portfolio for fallback
|
||||
@ -134,7 +134,7 @@ export async function createOffsetOrder(
|
||||
portfolioId: number,
|
||||
tons: number,
|
||||
dryRun: boolean = false,
|
||||
source?: string,
|
||||
source?: OffsetOrderSource,
|
||||
note?: string
|
||||
): Promise<OffsetOrder> {
|
||||
const startTime = Date.now();
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user