diff --git a/src/app/components/book/form/form.component.ts b/src/app/components/book/form/form.component.ts
index 90d78ad8..f1bf253d 100644
--- a/src/app/components/book/form/form.component.ts
+++ b/src/app/components/book/form/form.component.ts
@@ -24,6 +24,7 @@ export class FormComponent implements OnInit {
formGroup: FormGroup;
freightOptions: FreightOptions[] = [];
categories: Category[] = [];
+ facilitators: User[] = [];
isSaved: Boolean;
userProfile: string;
@@ -65,6 +66,10 @@ export class FormComponent implements OnInit {
this._scCategory.getAll().subscribe(data =>
this.categories = data
);
+
+ this._scUser.getAllFacilitators().subscribe(data =>
+ this.facilitators = data
+ );
}
createFormGroup() {
@@ -73,6 +78,7 @@ export class FormComponent implements OnInit {
title: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(200)]],
author: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(200)]],
categoryId: ['', [Validators.required]],
+ userIdFacilitator: ['', [Validators.required]],
userId: ['', [Validators.required]],
freightOption: ['', [Validators.required]],
imageBytes: [''],
@@ -115,6 +121,7 @@ export class FormComponent implements OnInit {
title: x.title,
author: x.author,
categoryId: x.categoryId,
+ userIdFacilitator: x.userIdFacilitator,
userId: x.userId,
freightOption: x.freightOption,
imageBytes: '',
diff --git a/src/app/core/models/book.ts b/src/app/core/models/book.ts
index 8d37b497..96d71024 100644
--- a/src/app/core/models/book.ts
+++ b/src/app/core/models/book.ts
@@ -11,6 +11,8 @@ export class Book {
userId: string;
categoryId: string;
user: User;
+ userIdFacilitator: string;
+ userFacilitator: User;
category: Category;
approved: boolean;
// bookUsers
diff --git a/src/app/core/services/user/user.service.ts b/src/app/core/services/user/user.service.ts
index 9e3c79b0..d77c0b80 100644
--- a/src/app/core/services/user/user.service.ts
+++ b/src/app/core/services/user/user.service.ts
@@ -77,4 +77,8 @@ export class UserService {
getProfile() {
return this._http.get
(`${this.config.apiEndpoint}/account/profile`);
}
+
+ getAllFacilitators() {
+ return this._http.get(`${this.config.apiEndpoint}/Account/ListFacilitators`);
+ }
}