Skip to content

Commit

Permalink
Merge pull request #196 from FJNR-inc/develop
Browse files Browse the repository at this point in the history
New feature
  • Loading branch information
RignonNoel authored Mar 24, 2021
2 parents 6c54c10 + 251ff61 commit 6b60258
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/components/pages/admin/retreats/retreats.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {RetreatTypeService} from '../../../../services/retreat-type.service';
import {Membership} from '../../../../models/membership';
import {AcademicLevel} from '../../../../models/academicLevel';
import {MembershipService} from '../../../../services/membership.service';
import {environment} from '../../../../../environments/environment';

interface Choice {
value: any;
Expand Down Expand Up @@ -363,6 +364,10 @@ export class RetreatsComponent implements OnInit {
const value = this.retreatBulkForm.value;
value['timezone'] = 'America/Montreal';

// Hardcode type Bloc since batch only work for virtual bloc
value['type'] = environment.url_base_api + environment.paths_api.retreat_types + '/' + environment.retreatTypeBlocId;

// Manage memberships
const formArray = this.retreatBulkForm.get('exclusive_memberships') as FormArray;
value['exclusive_memberships'] = [];
let index = 0;
Expand All @@ -373,6 +378,14 @@ export class RetreatsComponent implements OnInit {
index++;
}

// Manage weekdays for batch
const days = [];
for (const day of this.selectedDays) {
days.push(day.value);
}
value['weekdays'] = days;

// Execute with API
this.retreatService.createBulk(value).subscribe(
() => {
this.notificationService.success(
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const environment = {
// tslint:disable-next-line:max-line-length
token_paysafe: 'T1QtMjMxODcwOkItcWEyLTAtNWI4NmUxMDktMC0zMDJjMDIxNDJiMWI4YjNjZmMyNmM0YTc3ZTUzNTI0YjYzNzEwMzU3YWE1NmYzNWMwMjE0NjM5N2ZhZTJiMDZjNjFiYmFhNGQ1NGZjNDE2MjlhOGIxNzVmOTRhNw==',
defaultWorkplaceId: 6,
retreatTypeBlocId: 4,
defaultRetreatId: 1,
canHideFooter: false,
paths_api: {
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const environment = {
// tslint:disable-next-line:max-line-length
token_paysafe: 'U1VULTIwNzI3MjpCLXAxLTAtNWI5Mjg5OTItMC0zMDJjMDIxNDczNDgwYjc5NjM5OTRiZDRjMDFlYTQxODhlMzMxZmEwYWRlNjU3NDIwMjE0NjMzMGQ5OGQ0YjFiYTA3YjNjNmVmYjMxNTJlMWQyMTljNTI0MjI1ZA==',
defaultWorkplaceId: 1,
retreatTypeBlocId: 3,
defaultRetreatId: 1,
canHideFooter: false,
paths_api: {
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const environment = {
// tslint:disable-next-line:max-line-length
token_paysafe: 'T1QtMjM1MjAwOkItcWEyLTAtNWI4NDE0ZDYtMS0zMDJjMDIxNDEzMzhmMzEzN2FmZTgxNmUxMmE4YWJmYTk1NTVkN2VlZWQ5ZWU5ZjgwMjE0M2E1NzE5NDZjYzg3ODgwN2ZkZDU0NjkyODA1ZTg3ZjI5MjQ0ZGRiNg==',
defaultWorkplaceId: 1,
retreatTypeBlocId: 4,
defaultRetreatId: 1,
canHideFooter: false,
paths_api: {
Expand Down

0 comments on commit 6b60258

Please sign in to comment.