1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(edge-stacks): various custom template issues [BE-11414] (#189)

This commit is contained in:
Ali 2024-12-09 17:48:34 +13:00 committed by GitHub
parent 16a1825990
commit 97e7a3c5e2
24 changed files with 749 additions and 374 deletions

View file

@ -1,6 +1,6 @@
import { useMutation } from '@tanstack/react-query';
import { withError } from '@/react-tools/react-query';
import { withGlobalError } from '@/react-tools/react-query';
import { RegistryId } from '@/react/portainer/registries/types/registry';
import axios, {
json2formData,
@ -11,7 +11,7 @@ import { buildUrl } from './buildUrl';
export function useParseRegistries() {
return useMutation(parseRegistries, {
...withError('Failed parsing registries'),
...withGlobalError('Failed parsing registries'),
});
}
@ -23,7 +23,7 @@ export async function parseRegistries({
fileContent?: string;
}) {
if (!file && !fileContent) {
throw new Error('File or fileContent must be provided');
return [];
}
let currentFile = file;