fix: /summary 和 /by-type 接口补上权限过滤(之前遗漏)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -509,7 +509,7 @@ async function getWeeklyStats(): Promise<WeeklyStats> {
|
||||
|
||||
// GET /api/vehicles/summary
|
||||
app.get('/summary', async (c) => {
|
||||
const [vehicles, weekly] = await Promise.all([getVehicles(), getWeeklyStats()]);
|
||||
const [vehicles, weekly] = await Promise.all([getVehiclesForUser(c), getWeeklyStats()]);
|
||||
const summary: SummaryData = {
|
||||
totalAssets: vehicles.length,
|
||||
operating: {
|
||||
@@ -536,7 +536,7 @@ app.get('/summary', async (c) => {
|
||||
|
||||
// GET /api/vehicles/by-type
|
||||
app.get('/by-type', async (c) => {
|
||||
const [vehicles, weeklyIds] = await Promise.all([getVehicles(), getWeeklyTruckIds()]);
|
||||
const [vehicles, weeklyIds] = await Promise.all([getVehiclesForUser(c), getWeeklyTruckIds()]);
|
||||
|
||||
const typeFilters = [
|
||||
{ name: '4.5T普货', filter: (v: Vehicle) => v.type === '4.5T' && !v.model.includes('冷链') },
|
||||
|
||||
Reference in New Issue
Block a user