]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/forms/form-validators/custom-config-validators.service.ts
First implem global search
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / custom-config-validators.service.ts
index d20754d11dd0b1f5aec80b3344b5ccc1be43c0d5..fdb19e06a902bdc9867a63f162b059dcd3ed4c36 100644 (file)
@@ -14,6 +14,7 @@ export class CustomConfigValidatorsService {
   readonly ADMIN_EMAIL: BuildFormValidator
   readonly TRANSCODING_THREADS: BuildFormValidator
   readonly INDEX_URL: BuildFormValidator
+  readonly SEARCH_INDEX_URL: BuildFormValidator
 
   constructor (private i18n: I18n) {
     this.INSTANCE_NAME = {
@@ -81,11 +82,17 @@ export class CustomConfigValidatorsService {
     }
 
     this.INDEX_URL = {
-      VALIDATORS: [ Validators.required, Validators.pattern(/^https:\/\//) ],
+      VALIDATORS: [ Validators.pattern(/^https:\/\//) ],
       MESSAGES: {
-        'required': this.i18n('Index URL is required.'),
         'pattern': this.i18n('Index URL should be a URL')
       }
     }
+
+    this.SEARCH_INDEX_URL = {
+      VALIDATORS: [ Validators.pattern(/^https?:\/\//) ],
+      MESSAGES: {
+        'pattern': this.i18n('Search index URL should be a URL')
+      }
+    }
   }
 }