feat: JSON import + mapping presets in SPA
- Accept .json files in import upload, send format to backend
- Backend endpoint PUT /import/sessions/{id}/profile/{profile_id}
- Load saved presets on mapping step, auto-apply and skip to preview
- Save current mapping as preset on confirm step
- Delete presets from mapping step
This commit is contained in:
@@ -118,3 +118,17 @@ export async function upload<T>(
|
||||
body: form,
|
||||
})
|
||||
}
|
||||
|
||||
export async function uploadWithFields<T>(
|
||||
path: string,
|
||||
file: File,
|
||||
fields: Record<string, string>,
|
||||
): Promise<T> {
|
||||
const form = new FormData()
|
||||
form.append("file", file)
|
||||
for (const [k, v] of Object.entries(fields)) form.append(k, v)
|
||||
return request<T>(buildUrl(path), {
|
||||
method: "POST",
|
||||
body: form,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user