style: fix prettier formatting in assets.ts
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Failing after 0s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Failing after 0s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 7s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Successful in 45s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 44s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 12s
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Failing after 0s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Failing after 0s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 7s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Successful in 45s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 44s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 12s
This commit is contained in:
@@ -391,12 +391,21 @@ export interface BatchOperationResult {
|
||||
}
|
||||
|
||||
/** 统一批量操作结果归一化,防御后端字段缺失或格式不一致 */
|
||||
const normalizeBatchResult = (raw: Record<string, unknown>): BatchOperationResult => {
|
||||
const succeeded = Array.isArray(raw.succeeded) ? raw.succeeded as string[] : [];
|
||||
const failed = Array.isArray(raw.failed) ? raw.failed as string[] : [];
|
||||
const success_count = typeof raw.success_count === "number" ? raw.success_count : succeeded.length;
|
||||
const failure_count = typeof raw.failure_count === "number" ? raw.failure_count : failed.length;
|
||||
const total = typeof raw.total === "number" ? raw.total : success_count + failure_count;
|
||||
const normalizeBatchResult = (
|
||||
raw: Record<string, unknown>,
|
||||
): BatchOperationResult => {
|
||||
const succeeded = Array.isArray(raw.succeeded)
|
||||
? (raw.succeeded as string[])
|
||||
: [];
|
||||
const failed = Array.isArray(raw.failed) ? (raw.failed as string[]) : [];
|
||||
const success_count =
|
||||
typeof raw.success_count === "number"
|
||||
? raw.success_count
|
||||
: succeeded.length;
|
||||
const failure_count =
|
||||
typeof raw.failure_count === "number" ? raw.failure_count : failed.length;
|
||||
const total =
|
||||
typeof raw.total === "number" ? raw.total : success_count + failure_count;
|
||||
return { succeeded, failed, total, success_count, failure_count };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user