mirror of
https://github.com/LukeHagar/dokploy.git
synced 2025-12-06 04:19:37 +00:00
fix: load remote middleware on app delete if a serverId is provided
This commit is contained in:
@@ -46,8 +46,14 @@ export const deleteMiddleware = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const deleteAllMiddlewares = async (application: ApplicationNested) => {
|
export const deleteAllMiddlewares = async (application: ApplicationNested) => {
|
||||||
const config = loadMiddlewares<FileConfig>();
|
const { security, appName, redirects, serverId } = application;
|
||||||
const { security, appName, redirects } = application;
|
let config: FileConfig;
|
||||||
|
|
||||||
|
if (serverId) {
|
||||||
|
config = await loadRemoteMiddlewares(serverId);
|
||||||
|
} else {
|
||||||
|
config = loadMiddlewares<FileConfig>();
|
||||||
|
}
|
||||||
|
|
||||||
if (config.http?.middlewares) {
|
if (config.http?.middlewares) {
|
||||||
if (security.length > 0) {
|
if (security.length > 0) {
|
||||||
@@ -62,8 +68,8 @@ export const deleteAllMiddlewares = async (application: ApplicationNested) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (application.serverId) {
|
if (serverId) {
|
||||||
await writeTraefikConfigRemote(config, "middlewares", application.serverId);
|
await writeTraefikConfigRemote(config, "middlewares", serverId);
|
||||||
} else {
|
} else {
|
||||||
writeMiddleware(config);
|
writeMiddleware(config);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user