Skip to content

Commit

Permalink
improve user search
Browse files Browse the repository at this point in the history
  • Loading branch information
randomchars42 committed Jun 17, 2017
1 parent 885e733 commit e390e82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/services/olm.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ export class OlmService implements CanActivate {
.catch(this.handleError);
};

apiReadUsersByName(name: string): Observable<any[]> {
return this.http.get(this.urlOlm.concat(this.getEndpoint('user'), '/name/', name), this.jwt())
apiReadUsersBySearchTerm(term: string): Observable<any[]> {
return this.http.get(this.urlOlm.concat(this.getEndpoint('user'), '/search/', term), this.jwt())
.map(response => response.json())
.catch(this.handleError);
};
Expand Down
4 changes: 3 additions & 1 deletion src/app/user/users-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ <h1>Benutzer</h1>

<text-view [path]="'users-view'"></text-view>

<form>
<ul>
<li>
<label for="searchbox">Nutzer finden (&gt; 3 Buchstaben):</label>
<label for="searchbox">Nutzer finden aka "Magisches Finde-Feld":</label>
<input
type="text"
id="searchbox"
Expand All @@ -14,6 +15,7 @@ <h1>Benutzer</h1>
/>
</li>
</ul>
</form>

<ul class="items">
<li *ngFor="let item of items | async">
Expand Down
2 changes: 1 addition & 1 deletion src/app/user/users-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ export class UsersViewComponent implements OnInit {
if (term.length <= 3) {
return Observable.of<User[]>([]);
};
return this.olmService.apiReadUsersByName(term);
return this.olmService.apiReadUsersBySearchTerm(term);
};
}

0 comments on commit e390e82

Please sign in to comment.