Skip to content

Commit

Permalink
Added parameter to get parent in list with children (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
koliaBp authored Feb 24, 2023
1 parent cec2adc commit 26af743
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/app/shared/models/child.model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ParentWithContactInfo } from './parent.model';
import { DataItem } from './item.model';
import { Person } from './user.model';
import { ParentWithContactInfo } from './parent.model';
import { PaginationParameters } from './queryParameters.model';
import { Person } from './user.model';

export class Child implements Person {
id: string;
Expand Down Expand Up @@ -32,6 +32,7 @@ export class Child implements Person {

export interface ChildrenParameters extends PaginationParameters {
isParent?: boolean;
isGetParent?: boolean;
searchString?: string;
}
export interface RequestParams {
Expand Down
8 changes: 6 additions & 2 deletions src/app/shared/services/children/children.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ export class ChildrenService {
if (typeof parameters.isParent === 'boolean') {
params = params.set('isParent', parameters.isParent);
}
}

params = params.set('Size', parameters.size.toString()).set('From', parameters.from.toString());
if (typeof parameters.isGetParent === 'boolean') {
params = params.set('isGetParent', parameters.isGetParent);
}

params = params.set('Size', parameters.size.toString()).set('From', parameters.from.toString());
}

return params;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { combineLatest, Observable, Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';

import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute } from '@angular/router';
import { Select, Store } from '@ngxs/store';
import { combineLatest, Observable, Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { MatSelectChange } from '@angular/material/select';
import { MatTabChangeEvent } from '@angular/material/tabs';
import { ConfirmationModalWindowComponent } from '../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component';
import { ActivatedRoute } from '@angular/router';
import { Select, Store } from '@ngxs/store';

import {
ConfirmationModalWindowComponent
} from '../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component';
import { Constants, ModeConstants } from '../../../../shared/constants/constants';
import { ModalConfirmationType } from '../../../../shared/enum/modal-confirmation';
import { NavBarName } from '../../../../shared/enum/enumUA/navigation-bar';
import { ModalConfirmationType } from '../../../../shared/enum/modal-confirmation';
import { Application } from '../../../../shared/models/application.model';
import { Child, ChildrenParameters } from '../../../../shared/models/child.model';
import { ParentWithContactInfo } from '../../../../shared/models/parent.model';
import { SearchResponse } from '../../../../shared/models/search.model';
import { Workshop } from '../../../../shared/models/workshop.model';
import { NavigationBarService } from '../../../../shared/services/navigation-bar/navigation-bar.service';
import {
NavigationBarService
} from '../../../../shared/services/navigation-bar/navigation-bar.service';
import { AddNavPath, DeleteNavPath } from '../../../../shared/store/navigation.actions';
import { GetUsersChildren, CreateApplication, GetStatusIsAllowToApply } from '../../../../shared/store/parent.actions';
import {
CreateApplication, GetStatusIsAllowToApply, GetUsersChildren
} from '../../../../shared/store/parent.actions';
import { ParentState } from '../../../../shared/store/parent.state.';
import { RegistrationState } from '../../../../shared/store/registration.state';
import { GetWorkshopById } from '../../../../shared/store/shared-user.actions';
import { SharedUserState } from '../../../../shared/store/shared-user.state';
import { SearchResponse } from '../../../../shared/models/search.model';

@Component({
selector: 'app-create-application',
Expand Down Expand Up @@ -63,6 +71,7 @@ export class CreateApplicationComponent implements OnInit, OnDestroy {
childrenParameters: ChildrenParameters = {
searchString: '',
isParent: null,
isGetParent: true,
from: 0,
size: 0
};
Expand Down

0 comments on commit 26af743

Please sign in to comment.