chore(form): 🗑️ remove unused form components and types

* Refactor Former components to streamline functionality
* Update stories to reflect changes in form structure
This commit is contained in:
2026-01-14 21:56:55 +02:00
parent cd2f6db880
commit e777e1fa3a
38 changed files with 133 additions and 2125 deletions

View File

@@ -1,25 +1,25 @@
import type { FormerAPICallType } from './Former.types';
interface ResolveSpecRequest {
operation: 'read' | 'create' | 'update' | 'delete';
data?: Record<string, any>;
operation: 'create' | 'delete' | 'read' | 'update';
options?: {
preload?: string[];
columns?: string[];
computedColumns?: any[];
customOperators?: any[];
filters?: Array<{ column: string; operator: string; value: any }>;
sort?: string[];
limit?: number;
offset?: number;
customOperators?: any[];
computedColumns?: any[];
preload?: string[];
sort?: string[];
};
}
function FormerResolveSpecAPI(options: {
url: string;
authToken: string;
signal?: AbortSignal;
fetchOptions?: Partial<RequestInit>;
signal?: AbortSignal;
url: string;
}): FormerAPICallType {
return async (mode, request, value, key) => {
const baseUrl = options.url.replace(/\/$/, '');
@@ -50,13 +50,13 @@ function FormerResolveSpecAPI(options: {
cache: 'no-cache',
signal: options.signal,
...options.fetchOptions,
method: 'POST',
body: JSON.stringify(resolveSpecRequest),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${options.authToken}`,
'Content-Type': 'application/json',
...options.fetchOptions?.headers,
},
body: JSON.stringify(resolveSpecRequest),
method: 'POST',
};
const response = await fetch(url, fetchOptions);