mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-09-15 11:22:35 +00:00
add feature: set default server
This commit is contained in:
@@ -43,6 +43,22 @@ const internalProxyHost = {
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
// Get a list of the domain names and check each of them against default records
|
||||
if (data.default_server){
|
||||
if (data.domain_names.length > 1) {
|
||||
throw new error.ValidationError('Default server cant be set for multiple domain!');
|
||||
}
|
||||
|
||||
return internalHost
|
||||
.checkDefaultServerNotExist(data.domain_names[0])
|
||||
.then((result) => {
|
||||
if (!result){
|
||||
throw new error.ValidationError('One default server already exists');
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
// At this point the domains should have been checked
|
||||
data.owner_user_id = access.token.getUserId(1);
|
||||
@@ -140,6 +156,22 @@ const internalProxyHost = {
|
||||
});
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
// Get a list of the domain names and check each of them against default records
|
||||
if (data.default_server){
|
||||
if (data.domain_names.length > 1) {
|
||||
throw new error.ValidationError('Default server cant be set for multiple domain!');
|
||||
}
|
||||
|
||||
return internalHost
|
||||
.checkDefaultServerNotExist(data.domain_names[0])
|
||||
.then((result) => {
|
||||
if (!result){
|
||||
throw new error.ValidationError('One default server already exists');
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
return internalProxyHost.get(access, {id: data.id});
|
||||
})
|
||||
|
Reference in New Issue
Block a user