Skip to content

Commit

Permalink
search by enter added
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishali Sakar committed May 17, 2022
1 parent c4c6aed commit 9f12f91
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
</div>
<ng-container *ngIf="usersData">
<ws-widget-org-user-table [tableData]="tabledata" [data]="dataForTable" isUpload=true isCreate=true
(eOnCreateClick)="onCreateClick()" (eOnRowClick)="onRoleClick($event)" (actionsClick)="menuActions($event)">
(eOnCreateClick)="onCreateClick()" (eOnRowClick)="onRoleClick($event)" (actionsClick)="menuActions($event)"
(searchByEnterKey)="onEnterkySearch($event)">
</ws-widget-org-user-table>
</ng-container>
</mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,16 @@ export class UsersViewComponent implements OnInit, OnDestroy {
// break
}
}

onEnterkySearch(enterValue: any) {
const rootOrgId = _.get(this.route.snapshot.parent, 'data.configService.unMappedUser.rootOrg.rootOrgId')

this.usersService.searchUserByenter(enterValue, rootOrgId).subscribe(data => {
// console.log(data.result.response)
this.usersData = data.result.response
this.filterData()
}
)

}
}
15 changes: 14 additions & 1 deletion project/ws/app/src/lib/routes/users/services/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const API_END_POINTS = {
ACTIVE_USER: 'apis/proxies/v8/user/v1/unblock',
DE_ACTIVE_USER: 'apis/proxies/v8/user/v1/block',
NEW_USER_BLOCK_API: '/apis/proxies/v8/user/v1/block',
NEW_USER_UN_BLOCK_API: '/apis/proxies/v8/user/v1/unblock'
NEW_USER_UN_BLOCK_API: '/apis/proxies/v8/user/v1/unblock',
SEARCH_USER_TABLE: '/apis/proxies/v8/user/v1/search',

// GET_BULKUPLOAD_DATA: '/apis/protected/v8/admin/userRegistration/bulkUploadData',
}
Expand Down Expand Up @@ -117,4 +118,16 @@ export class UsersService {
}
return this.http.post<any>(`${API_END_POINTS.GET_ALL_USERS}`, reqBody)
}
searchUserByenter(value: string, rootOrgId: string) {
const reqBody = {
request: {
query: value,
filters: {
rootOrgId,
},
},
}

return this.http.post<any>(`${API_END_POINTS.SEARCH_USER_TABLE}`, reqBody)
}
}

0 comments on commit 9f12f91

Please sign in to comment.