feat: add edit group page (#1037)

Fixes: #1036
This commit is contained in:
Karan Takalkar
2020-07-08 18:56:41 +05:30
committed by GitHub
parent 205ce6bdc2
commit 7f33fc23c9
10 changed files with 253 additions and 20 deletions
@@ -146,22 +146,22 @@ export class CreateGroupComponent implements OnInit, AfterViewInit {
* if successful redirects to groups.
*/
submit() {
const submittedOnDate: Date = this.groupForm.value.submittedOnDate;
const activationDate: Date = this.groupForm.value.activationDate;
// TODO: Update once language and date settings are setup
const dateFormat = 'dd MMMM yyyy';
this.groupForm.patchValue({
submittedOnDate: this.datePipe.transform(submittedOnDate, dateFormat),
activationDate: this.datePipe.transform(activationDate, dateFormat)
});
const group = this.groupForm.value;
group.locale = 'en';
group.dateFormat = dateFormat;
group.clientMembers = [];
this.clientMembers.forEach((client: any) => group.clientMembers.push(client.id));
this.groupService.createGroup(group).subscribe((response: any) => {
this.router.navigate(['../groups']);
});
const submittedOnDate: Date = this.groupForm.value.submittedOnDate;
const activationDate: Date = this.groupForm.value.activationDate;
// TODO: Update once language and date settings are setup
const dateFormat = 'dd MMMM yyyy';
this.groupForm.patchValue({
submittedOnDate: this.datePipe.transform(submittedOnDate, dateFormat),
activationDate: this.datePipe.transform(activationDate, dateFormat)
});
const group = this.groupForm.value;
group.locale = 'en';
group.dateFormat = dateFormat;
group.clientMembers = [];
this.clientMembers.forEach((client: any) => group.clientMembers.push(client.id));
this.groupService.createGroup(group).subscribe((response: any) => {
this.router.navigate(['../groups']);
});
}
}