Skip to content
Snippets Groups Projects
Commit d9f3bc1a authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Add function for getting userId

parent 9f97588f
Branches
Tags
No related merge requests found
......@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
import { Moderator } from '../../models/moderator';
import { catchError, tap } from 'rxjs/operators';
import { BaseHttpService } from './base-http.service';
import { User } from '../../models/user';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
......@@ -15,6 +16,7 @@ export class ModeratorService extends BaseHttpService {
base: '/api',
room: '/room',
moderator: '/moderator',
user: '/user',
find: '/find'
};
......@@ -45,4 +47,15 @@ export class ModeratorService extends BaseHttpService {
catchError(this.handleError<any>('deleteModerator'))
);
}
getUserId(loginId: string): Observable<User[]> {
const url = `${this.apiUrl.base + this.apiUrl.user}/${this.apiUrl.find}`;
return this.http.post<User[]>(url, {
properties: { loginId: loginId },
externalFilters: {}
}).pipe(
tap(() => ''),
catchError(this.handleError('getUserId', []))
);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment