Skip to content

Commit 5ff0963

Browse files
committed
chore(repos): remove trailing and leading / from root_path (PPT-2437)
1 parent f5d336e commit 5ff0963

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/app/repositories/repository-form.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,16 @@ export class RepositoryFormComponent extends AsyncHandler implements OnInit {
499499
this.saving = i18n(`${this._name}.SAVING`);
500500
this._dialog_ref.disableClose = true;
501501
const item_json = item.toJSON ? item.toJSON() : item;
502+
const form_value = { ...this.form.value };
503+
if (form_value.root_path) {
504+
form_value.root_path = form_value.root_path.replace(
505+
/^\/+|\/+$/g,
506+
'',
507+
);
508+
}
502509
const form_item: PlaceRepository = item.id
503-
? cleanObject({ ...item_json, ...this.form.value }, [undefined])
504-
: { ...item_json, ...this.form.value };
510+
? cleanObject({ ...item_json, ...form_value }, [undefined])
511+
: { ...item_json, ...form_value };
505512
(form_item.id
506513
? updateRepository(
507514
form_item.id,

0 commit comments

Comments
 (0)