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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user