dl-commons 0.0.2-testing.34 → 0.0.2-testing.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dl-commons",
3
3
  "type": "commonjs",
4
- "version": "0.0.2-testing.34",
4
+ "version": "0.0.2-testing.36",
5
5
  "description": "distance learning commons",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,6 +11,8 @@ export interface IGroupEmbedded extends IBase {
11
11
  students: IStudentEmbedded[];
12
12
  sessions: IGroupSession[];
13
13
  knowladgeLevels: IDictionary[];
14
+ minAge: number;
15
+ maxAge: number;
14
16
  description: II18n;
15
17
  state: GroupState;
16
18
  startDate: Date;
@@ -20,7 +20,7 @@ export class GroupsService {
20
20
  //#endregion
21
21
 
22
22
  //#region Public API
23
- public async readGroup(id: string): Promise<RESTResult<IGroupEmbedded>> {
23
+ public async readGroup(id: string): Promise<IGroupEmbedded> {
24
24
  try {
25
25
  const endpoint = `${this._baseUrl}/v1/groups/${id}`;
26
26
  const response$ = this._httpService.get<RESTResponseBody<IGroupEmbedded>>(endpoint);
@@ -34,13 +34,13 @@ export class GroupsService {
34
34
  throw new RESTError('students_api_error', 'empty response');
35
35
  }
36
36
 
37
- return response.data.result;
37
+ return response.data.result.data;
38
38
  } catch (e) {
39
39
  throw RESTError.createFromCatch(e, { keyword: 'unknown', debug: e });
40
40
  }
41
41
  }
42
42
 
43
- public async readGroupRequest(id: string): Promise<RESTResult<IGroupRequestEmbedded>> {
43
+ public async readGroupRequest(id: string): Promise<IGroupRequestEmbedded> {
44
44
  try {
45
45
  const endpoint = `${this._baseUrl}/v1/group-requests/${id}`;
46
46
  const response$ = this._httpService.get<RESTResponseBody<IGroupRequestEmbedded>>(endpoint);
@@ -54,7 +54,7 @@ export class GroupsService {
54
54
  throw new RESTError('students_api_error', 'empty response');
55
55
  }
56
56
 
57
- return response.data.result;
57
+ return response.data.result.data;
58
58
  } catch (e) {
59
59
  throw RESTError.createFromCatch(e, { keyword: 'unknown', debug: e });
60
60
  }
@@ -19,7 +19,7 @@ export class StudentsService {
19
19
  //#endregion
20
20
 
21
21
  //#region Public API
22
- public async read(id: string): Promise<RESTResult<IStudentEmbedded>> {
22
+ public async read(id: string): Promise<IStudentEmbedded> {
23
23
  try {
24
24
  const endpoint = `${this._baseUrl}/v1/students/${id}`;
25
25
  const response$ = this._httpService.get<RESTResponseBody<IStudentEmbedded>>(endpoint);
@@ -33,7 +33,7 @@ export class StudentsService {
33
33
  throw new RESTError('students_api_error', 'empty response');
34
34
  }
35
35
 
36
- return response.data.result;
36
+ return response.data.result.data;
37
37
  } catch (e) {
38
38
  throw RESTError.createFromCatch(e, { keyword: 'unknown', debug: e });
39
39
  }