mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
fix(api): if domains field is empty clear the fqdn column
- providing an empty string for `domains` allows the ability to remove all URLs from the domains field
This commit is contained in:
@@ -2577,6 +2577,12 @@ class ApplicationsController extends Controller
|
|||||||
$errors = [];
|
$errors = [];
|
||||||
$urls = str($urls)->trim()->explode(',')->map(function ($url) use (&$errors) {
|
$urls = str($urls)->trim()->explode(',')->map(function ($url) use (&$errors) {
|
||||||
$url = trim($url);
|
$url = trim($url);
|
||||||
|
|
||||||
|
// If "domains" is empty clear all URLs from the fqdn column
|
||||||
|
if (blank($url)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (! filter_var($url, FILTER_VALIDATE_URL)) {
|
if (! filter_var($url, FILTER_VALIDATE_URL)) {
|
||||||
$errors[] = 'Invalid URL: '.$url;
|
$errors[] = 'Invalid URL: '.$url;
|
||||||
|
|
||||||
@@ -3841,6 +3847,12 @@ class ApplicationsController extends Controller
|
|||||||
$errors = [];
|
$errors = [];
|
||||||
$urls = str($urls)->trim()->explode(',')->map(function ($url) use (&$errors) {
|
$urls = str($urls)->trim()->explode(',')->map(function ($url) use (&$errors) {
|
||||||
$url = trim($url);
|
$url = trim($url);
|
||||||
|
|
||||||
|
// If "domains" is empty clear all URLs from the fqdn column
|
||||||
|
if (blank($url)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (! filter_var($url, FILTER_VALIDATE_URL)) {
|
if (! filter_var($url, FILTER_VALIDATE_URL)) {
|
||||||
$errors[] = 'Invalid URL: '.$url;
|
$errors[] = 'Invalid URL: '.$url;
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ function sharedDataApplications()
|
|||||||
'is_auto_deploy_enabled' => 'boolean',
|
'is_auto_deploy_enabled' => 'boolean',
|
||||||
'is_force_https_enabled' => 'boolean',
|
'is_force_https_enabled' => 'boolean',
|
||||||
'static_image' => Rule::enum(StaticImageTypes::class),
|
'static_image' => Rule::enum(StaticImageTypes::class),
|
||||||
'domains' => 'string',
|
'domains' => 'string|nullable',
|
||||||
'redirect' => Rule::enum(RedirectTypes::class),
|
'redirect' => Rule::enum(RedirectTypes::class),
|
||||||
'git_commit_sha' => 'string',
|
'git_commit_sha' => 'string',
|
||||||
'docker_registry_image_name' => 'string|nullable',
|
'docker_registry_image_name' => 'string|nullable',
|
||||||
|
|||||||
Reference in New Issue
Block a user