test(frontend): add test coverage for drawing, organization, and migration services
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
// File: frontend/lib/services/migration.service.ts
|
||||
// Change Log:
|
||||
// - 2026-06-13: Add support for direct array response in normalizePaginatedResponse and add file header
|
||||
|
||||
import api from '../api/client';
|
||||
import {
|
||||
MigrationReviewQueueItem,
|
||||
@@ -38,6 +42,16 @@ const normalizePaginatedResponse = <T>(value: unknown): PaginatedResponse<T> =>
|
||||
};
|
||||
}
|
||||
|
||||
if (Array.isArray(extracted)) {
|
||||
return {
|
||||
items: extracted as T[],
|
||||
total: extracted.length,
|
||||
page: 1,
|
||||
limit: extracted.length,
|
||||
totalPages: 1,
|
||||
};
|
||||
}
|
||||
|
||||
const response = extracted as Partial<PaginatedResponse<T>> & { data?: unknown };
|
||||
|
||||
if (Array.isArray(response.items)) {
|
||||
|
||||
Reference in New Issue
Block a user