Aktualisierung der Angular-Api-Dienste entsprechend dem DTO.
This commit is contained in:
@@ -151,13 +151,8 @@ export class BaseTableComponent<TModel, TApiService extends ApiService<TModel>>
|
|||||||
fetchData(): void {
|
fetchData(): void {
|
||||||
this.service.getAll().subscribe({
|
this.service.getAll().subscribe({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
if (response.isSuccess && response.data) {
|
this.source = response;
|
||||||
this.source = response.data;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
} else {
|
|
||||||
// Handle response failure
|
|
||||||
console.error('Failed to fetch users');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: (error) => console.error('Error fetching users:', error)
|
error: (error) => console.error('Error fetching users:', error)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,17 +17,11 @@ export class DirUserTableComponent extends BaseTableComponent<DirUser, DirUserSe
|
|||||||
|
|
||||||
fetchDataByGroupName(groupName: string): void {
|
fetchDataByGroupName(groupName: string): void {
|
||||||
this.service.getAll(groupName).subscribe({
|
this.service.getAll(groupName).subscribe({
|
||||||
next: (response) => {
|
next: (response: any) => {
|
||||||
if (response.isSuccess && response.data) {
|
this.source = response;
|
||||||
this.source = response.data;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
} else {
|
|
||||||
// Handle response failure
|
|
||||||
this.loading = false;
|
|
||||||
console.error('Failed to fetch users');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: (error) => console.error('Error fetching users:', error)
|
error: (error: any) => console.error('Error fetching users:', error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,12 +20,7 @@ export class GroupUserTableComponent extends BaseTableComponent<GroupOfUser, Gro
|
|||||||
fetchDataWith(withUser: boolean, withGroup: boolean){
|
fetchDataWith(withUser: boolean, withGroup: boolean){
|
||||||
this.service.getAll(withUser, withGroup).subscribe ({
|
this.service.getAll(withUser, withGroup).subscribe ({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
if (response.isSuccess && response.data) {
|
this.source = response;
|
||||||
this.source = response.data;
|
|
||||||
} else {
|
|
||||||
// Handle response failure
|
|
||||||
console.error('Failed to fetch users');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: (error) => console.error('Error fetching users:', error)
|
error: (error) => console.error('Error fetching users:', error)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { UserRep } from 'src/app/models/user-management.api.models';
|
import { UserRep } from '../../../models/user-management.api.models';
|
||||||
import { UserRepService } from 'src/app/services/user-representation.service';
|
import { UserRepService } from '../../../services/user-representation.service';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { GuiColumn } from '@generic-ui/ngx-grid';
|
import { GuiColumn } from '@generic-ui/ngx-grid';
|
||||||
import { ColorModeService } from 'src/app/services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-rep-table',
|
selector: 'app-user-rep-table',
|
||||||
@@ -19,16 +19,11 @@ export class UserRepTableComponent extends BaseTableComponent<UserRep, UserRepSe
|
|||||||
|
|
||||||
override fetchData(userId?: number): void {
|
override fetchData(userId?: number): void {
|
||||||
this.service.getAll(false, true, true, true, userId).subscribe({
|
this.service.getAll(false, true, true, true, userId).subscribe({
|
||||||
next: (response) => {
|
next: (response: any) => {
|
||||||
if (response.isSuccess && response.data) {
|
this.source = response;
|
||||||
this.source = response.data;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
} else {
|
|
||||||
// Handle response failure
|
|
||||||
console.error('Failed to fetch users');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: (error) => console.error('Error fetching users:', error)
|
error: (error: any) => console.error('Error fetching users:', error)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ import { GroupOfUserService } from '../../../services/group-of-user.service';
|
|||||||
import { User } from '../../../models/user-management.api.models';
|
import { User } from '../../../models/user-management.api.models';
|
||||||
import { GuiColumn } from '@generic-ui/ngx-grid';
|
import { GuiColumn } from '@generic-ui/ngx-grid';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { ColorModeService } from 'src/app/services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-table',
|
selector: 'app-user-table',
|
||||||
@@ -25,14 +25,8 @@ export class UserTableComponent extends BaseTableComponent<User, UserService> {
|
|||||||
|
|
||||||
fetchDataByModuleId(moduleId: number, assigned: boolean = true): void {
|
fetchDataByModuleId(moduleId: number, assigned: boolean = true): void {
|
||||||
this.service.getByModuleId(moduleId, assigned).subscribe({
|
this.service.getByModuleId(moduleId, assigned).subscribe({
|
||||||
next: (response) => {
|
next: (users) => {
|
||||||
|
this.source = users;
|
||||||
if (response.isSuccess && response.data) {
|
|
||||||
this.source = response.data;
|
|
||||||
} else {
|
|
||||||
// Handle response failure
|
|
||||||
console.error('Failed to fetch users');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: (error) => console.error('Error fetching users:', error)
|
error: (error) => console.error('Error fetching users:', error)
|
||||||
});
|
});
|
||||||
@@ -40,13 +34,8 @@ export class UserTableComponent extends BaseTableComponent<User, UserService> {
|
|||||||
|
|
||||||
fetchDataByGroupId(groupId: number, assigned: boolean = true): void {
|
fetchDataByGroupId(groupId: number, assigned: boolean = true): void {
|
||||||
this.service.getByGroupId(groupId, assigned).subscribe({
|
this.service.getByGroupId(groupId, assigned).subscribe({
|
||||||
next: (response) => {
|
next: (users) => {
|
||||||
if (response.isSuccess && response.data) {
|
this.source = users;
|
||||||
this.source = response.data;
|
|
||||||
} else {
|
|
||||||
// Handle response failure
|
|
||||||
console.error('Failed to fetch users');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error: (error) => console.error('Error fetching users:', error)
|
error: (error) => console.error('Error fetching users:', error)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
export interface ApiMessage {
|
|
||||||
isSuccess: boolean;
|
|
||||||
messages: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ApiResult<T> extends ApiMessage {
|
|
||||||
data?: T;
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Inject, Injectable } from '@angular/core';
|
import { Inject, Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
import { ApiMessage, ApiResult } from '../models/api.response.model';
|
|
||||||
import { AuthCheckDto } from '../models/user-management.api.models';
|
import { AuthCheckDto } from '../models/user-management.api.models';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
@@ -50,14 +49,16 @@ export class AuthenticationService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(): Observable<ApiMessage> {
|
logout(): Observable<any> {
|
||||||
return new Observable(observer => {
|
return new Observable(observer => {
|
||||||
this.http.post<ApiMessage>(this.logoutUrl, {}, { withCredentials: true })
|
this.http.post<any>(this.logoutUrl, {}, { withCredentials: true })
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
|
if (response.ok) {
|
||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
_isLogedIn = false;
|
_isLogedIn = false;
|
||||||
observer.next(response)
|
observer.next(response)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: (error) => observer.error(error),
|
error: (error) => observer.error(error),
|
||||||
complete: () => observer.complete()
|
complete: () => observer.complete()
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { DirGroup, DirUser } from '../models/user-management.api.models';
|
import { DirGroup, } from '../models/user-management.api.models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './user-management.api.service';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
|
|
||||||
@@ -14,21 +13,20 @@ export class DirGroupService extends ApiService<DirGroup> {
|
|||||||
super(http, userUri);
|
super(http, userUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getAll(): Observable<ApiResult<DirGroup[]>> {
|
//TODO: Swal.fire
|
||||||
return new Observable(observer => {
|
override getAll(): Observable<DirGroup[]> {
|
||||||
|
return new Observable<DirGroup[]>(observer => {
|
||||||
super.getAll()
|
super.getAll()
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
if(!response.isSuccess || !response.data) {
|
observer.next(response)
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: "error",
|
icon: "error",
|
||||||
title: "Oops...",
|
title: "Oops...",
|
||||||
text: `Active Directory-Verbindung verloren. Bitte melden Sie sich erneut an`,
|
text: `Active Directory-Verbindung verloren. Bitte melden Sie sich erneut an`,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
observer.next(response)
|
|
||||||
},
|
|
||||||
error: (error) => {
|
|
||||||
observer.error(error)
|
observer.error(error)
|
||||||
},
|
},
|
||||||
complete: () => observer.complete()
|
complete: () => observer.complete()
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { HttpClient, HttpParams } from '@angular/common/http';
|
|||||||
import { DirUser } from '../models/user-management.api.models';
|
import { DirUser } from '../models/user-management.api.models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './user-management.api.service';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -13,12 +12,12 @@ export class DirUserService extends ApiService<DirUser> {
|
|||||||
super(http, userUri);
|
super(http, userUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
override getAll(groupName?: string): Observable<ApiResult<DirUser[]>> {
|
override getAll(groupName?: string): Observable<DirUser[]> {
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
if (groupName) {
|
if (groupName) {
|
||||||
params = params.set('groupName', groupName);
|
params = params.set('groupName', groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.get<ApiResult<DirUser[]>>(this.baseUrl, { params, withCredentials: true });
|
return this.http.get<DirUser[]>(this.baseUrl, { params, withCredentials: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
import { Inject, Injectable } from '@angular/core';
|
import { Inject, Injectable } from '@angular/core';
|
||||||
import { DirUser } from '../models/user-management.api.models';
|
import { DirUser } from '../models/user-management.api.models';
|
||||||
|
|
||||||
@@ -12,12 +11,12 @@ export class DirService {
|
|||||||
this.http = http;
|
this.http = http;
|
||||||
}
|
}
|
||||||
|
|
||||||
getUser(groupName: string): Observable<ApiResult<DirUser[]>> {
|
getUser(groupName: string): Observable<DirUser[]> {
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
if (groupName) {
|
if (groupName) {
|
||||||
params = params.set('groupName', groupName);
|
params = params.set('groupName', groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.get<ApiResult<DirUser[]>>(this.baseUrl, { params, withCredentials: true });
|
return this.http.get<DirUser[]>(this.baseUrl, { params, withCredentials: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ import { Injectable, Inject } from '@angular/core';
|
|||||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||||
import { GroupOfUser } from '../models/user-management.api.models';
|
import { GroupOfUser } from '../models/user-management.api.models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './user-management.api.service';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -13,12 +12,12 @@ export class GroupOfUserService extends ApiService<GroupOfUser> {
|
|||||||
super(http, userUri);
|
super(http, userUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteByGroupUserId(groupId: number, userId: number): Observable<ApiResult<any>> {
|
deleteByGroupUserId(groupId: number, userId: number): Observable<any> {
|
||||||
const url = `${this.baseUrl}?groupId=${groupId}&userId=${userId}`;
|
const url = `${this.baseUrl}?groupId=${groupId}&userId=${userId}`;
|
||||||
return this.http.delete<ApiResult<any>>(url, { withCredentials: true });
|
return this.http.delete<any>(url, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
override getAll(withUser: boolean = false, withGroup: boolean = false): Observable<ApiResult<GroupOfUser[]>> {
|
override getAll(withUser: boolean = false, withGroup: boolean = false): Observable<GroupOfUser[]> {
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
if (withUser) {
|
if (withUser) {
|
||||||
params = params.set('withUser', withUser);
|
params = params.set('withUser', withUser);
|
||||||
@@ -27,6 +26,6 @@ export class GroupOfUserService extends ApiService<GroupOfUser> {
|
|||||||
params = params.set('withGroup', withGroup);
|
params = params.set('withGroup', withGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.get<ApiResult<GroupOfUser[]>>(this.baseUrl, { params, withCredentials: true });
|
return this.http.get<GroupOfUser[]>(this.baseUrl, { params, withCredentials: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ import { Injectable, Inject } from '@angular/core';
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { ModuleOfUser } from '../models/user-management.api.models';
|
import { ModuleOfUser } from '../models/user-management.api.models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './user-management.api.service';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -13,8 +12,8 @@ export class ModuleOfUserService extends ApiService<ModuleOfUser> {
|
|||||||
super(http, userUri);
|
super(http, userUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteByModuleGroupId(moduleId: number, userId: number): Observable<ApiResult<any>> {
|
deleteByModuleGroupId(moduleId: number, userId: number): Observable<any> {
|
||||||
const url = `${this.baseUrl}?moduleId=${moduleId}&userId=${userId}`;
|
const url = `${this.baseUrl}?moduleId=${moduleId}&userId=${userId}`;
|
||||||
return this.http.delete<ApiResult<any>>(url, { withCredentials: true });
|
return this.http.delete<any>(url, { withCredentials: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
import { Inject, Injectable } from '@angular/core';
|
import { Inject, Injectable } from '@angular/core';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -15,26 +14,26 @@ export class ApiService<Model> {
|
|||||||
http: HttpClient;
|
http: HttpClient;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
|
|
||||||
getAll(): Observable<ApiResult<Model[]>> {
|
getAll(): Observable<Model[]> {
|
||||||
return this.http.get<ApiResult<Model[]>>(this.baseUrl, { withCredentials: true });
|
return this.http.get<Model[]>(this.baseUrl, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
getById(id: number): Observable<ApiResult<Model>> {
|
getById(id: number): Observable<Model> {
|
||||||
const url = `${this.baseUrl}/${id}`;
|
const url = `${this.baseUrl}/${id}`;
|
||||||
return this.http.get<ApiResult<Model>>(url, { withCredentials: true });
|
return this.http.get<Model>(url, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
create(createModel: Model): Observable<Model> {
|
create(createModel: Model): Observable<Model> {
|
||||||
return this.http.post<Model>(this.baseUrl, createModel, { withCredentials: true });
|
return this.http.post<Model>(this.baseUrl, createModel, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
update(updateModel: Model): Observable<ApiResult<Model>> {
|
update(updateModel: Model): Observable<Model> {
|
||||||
const url = `${this.baseUrl}`;
|
const url = `${this.baseUrl}`;
|
||||||
return this.http.put<ApiResult<Model>>(url, updateModel, { withCredentials: true });
|
return this.http.put<Model>(url, updateModel, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(id: number): Observable<ApiResult<any>> {
|
delete(id: number): Observable<any> {
|
||||||
const url = `${this.baseUrl}/${id}`;
|
const url = `${this.baseUrl}/${id}`;
|
||||||
return this.http.delete<ApiResult<any>>(url, { withCredentials: true });
|
return this.http.delete<any>(url, { withCredentials: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ import { Inject, Injectable } from "@angular/core";
|
|||||||
import { UserRep } from "../models/user-management.api.models";
|
import { UserRep } from "../models/user-management.api.models";
|
||||||
import { ApiService } from "./user-management.api.service";
|
import { ApiService } from "./user-management.api.service";
|
||||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
import { HttpClient, HttpParams } from "@angular/common/http";
|
||||||
import { ApiResult } from "../models/api.response.model";
|
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -13,7 +12,7 @@ export class UserRepService extends ApiService<UserRep> {
|
|||||||
super(http, userRepUri)
|
super(http, userRepUri)
|
||||||
}
|
}
|
||||||
|
|
||||||
override getAll(withUser: boolean = false, withRepGroup: boolean = false, withRightGroup: boolean = false, withRepUser: boolean = false, userId?: number): Observable<ApiResult<UserRep[]>> {
|
override getAll(withUser: boolean = false, withRepGroup: boolean = false, withRightGroup: boolean = false, withRepUser: boolean = false, userId?: number): Observable<UserRep[]> {
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
if (withUser) {
|
if (withUser) {
|
||||||
params = params.set('withUser', withUser);
|
params = params.set('withUser', withUser);
|
||||||
@@ -31,6 +30,6 @@ export class UserRepService extends ApiService<UserRep> {
|
|||||||
params = params.set('userId', userId)
|
params = params.set('userId', userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.get<ApiResult<UserRep[]>>(`${this.baseUrl}`, { params: params, withCredentials: true });
|
return this.http.get<UserRep[]>(`${this.baseUrl}`, { params: params, withCredentials: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ import { HttpClient } from '@angular/common/http';
|
|||||||
import { DirUser, User } from '../models/user-management.api.models';
|
import { DirUser, User } from '../models/user-management.api.models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './user-management.api.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ApiResult } from '../models/api.response.model';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -13,14 +12,14 @@ export class UserService extends ApiService<User> {
|
|||||||
super(http, userUri);
|
super(http, userUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
getByModuleId(moduleId: number, assigned: boolean = true): Observable<ApiResult<User[]>> {
|
getByModuleId(moduleId: number, assigned: boolean = true): Observable<User[]> {
|
||||||
const url = `${this.baseUrl}/ByModuleId/${moduleId}?assigned=${assigned}`;
|
const url = `${this.baseUrl}/ByModuleId/${moduleId}?assigned=${assigned}`;
|
||||||
return this.http.get<ApiResult<User[]>>(url, { withCredentials: true });
|
return this.http.get<User[]>(url, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
getByGroupId(groupId: number, assigned: boolean = true): Observable<ApiResult<User[]>> {
|
getByGroupId(groupId: number, assigned: boolean = true): Observable<User[]> {
|
||||||
const url = `${this.baseUrl}/ByGroupId/${groupId}?assigned=${assigned}`;
|
const url = `${this.baseUrl}/ByGroupId/${groupId}?assigned=${assigned}`;
|
||||||
return this.http.get<ApiResult<User[]>>(url, { withCredentials: true });
|
return this.http.get<User[]>(url, { withCredentials: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
createByDir(createModel: DirUser): Observable<DirUser> {
|
createByDir(createModel: DirUser): Observable<DirUser> {
|
||||||
|
|||||||
Reference in New Issue
Block a user