← All changes
|
js/components/ImportMenu/MigrateForm/WithMigrationData.tsx
+3
-3
3.10.1
→
4.0.0-beta.2
View file →
| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | if (!importer) { |
| 56 | 56 | throw new Error(__('Please select an importer.', 'code-snippets')) |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - const response = await api.post<ImportResponse, ImportRequest>(`${REST_BASES.importPlugins}/${importer}/import`, request) | |
| 59 | + const response = await api.post<ImportResponse, ImportRequest>(`${REST_BASES.import.plugins}/${importer}/import`, request) | |
| 60 | 60 | |
| 61 | 61 | if (1 > response.imported.length) { |
| 62 | 62 | throw new Error(__('No snippets were imported.', 'code-snippets')) |
| 63 | 63 | } |
| @@ -120,15 +120,15 @@ | ||
| 120 | 120 | const snippetSelection = useSelection(snippets, snippet => snippet.table_data.id) |
| 121 | 121 | |
| 122 | 122 | useEffect(() => { |
| 123 | 123 | fetchImporters(() => api |
| 124 | - .get<Record<string, Importer>>(REST_BASES.importPlugins) | |
| 124 | + .get<Record<string, Importer>>(REST_BASES.import.plugins) | |
| 125 | 125 | .then(response => Object.values(response))) |
| 126 | 126 | }, [api, fetchImporters]) |
| 127 | 127 | |
| 128 | 128 | useEffect(() => { |
| 129 | 129 | if (selectedImporter) { |
| 130 | - fetchSnippets(() => api.get<ImportableSnippet[]>(`${REST_BASES.importPlugins}/${selectedImporter}`)) | |
| 130 | + fetchSnippets(() => api.get<ImportableSnippet[]>(`${REST_BASES.import.plugins}/${selectedImporter}`)) | |
| 131 | 131 | } |
| 132 | 132 | }, [api, selectedImporter, fetchSnippets]) |
| 133 | 133 | |
| 134 | 134 | const importSnippets = () => { |