forked from tykayn/funky-framadate-front
smaller uniq id in custom_url
This commit is contained in:
parent
f1e5903d0a
commit
5d39b7aa3e
@ -142,6 +142,7 @@ export class PollService implements Resolve<Poll> {
|
||||
}
|
||||
|
||||
public convertTextToSlug(str: string) {
|
||||
str = str.trim();
|
||||
str = str.replace(/^\s+|\s+$/g, ''); // trim
|
||||
str = str.toLowerCase();
|
||||
|
||||
|
@ -46,6 +46,11 @@ export class BaseConfigComponent {
|
||||
* set the poll custom_url from other data of the poll
|
||||
*/
|
||||
automaticSlug(): void {
|
||||
this.form.patchValue({ custom_url: this.utilitiesService.makeUuid() });
|
||||
this.form.patchValue({
|
||||
custom_url:
|
||||
this.pollService.convertTextToSlug(this.form.value.title) +
|
||||
'_' +
|
||||
this.utilitiesService.makeUuid().substr(0, 12),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user