placidenduwayo 2 лет назад
Родитель
Сommit
d9027b2718
1 измененных файлов: 18 добавлений и 17 удалений
  1. 18
    17
      src/app/ngrx/users/users.actions.ts

+ 18
- 17
src/app/ngrx/users/users.actions.ts Просмотреть файл

@@ -1,48 +1,51 @@
1 1
 import { Action } from '@ngrx/store';
2 2
 import { User } from 'src/app/shared/models/user.model';
3 3
 
4
-//type of actions
4
+/**type of actions*/
5 5
 
6 6
 export enum UserActionType {
7
-  /* action: get all users */
7
+
8
+  // action: get all users
8 9
   GET_ALL_USERS = '[User] GET ALL USERS',
9 10
   GET_ALL_USERS_SUCCESS = '[User] GET-ALL USERS SUCCESS',
10 11
   GET_ALL_USERS_ERROR = '[User] GET-ALL USERS ERROR',
11 12
 
12
-  /* action: search a user */
13
+  // action: search a user
13 14
   SEARCH_A_USER = '[User] SEARCH A USER',
14 15
   SEARCH_A_USER_SUCCESS = '[User] SEARCH A USER SUCCESS',
15 16
   SEARCH_A_USER_ERROR = '[User] SEARCH A USER ERROR',
16 17
 
17 18
 
18
-  /** action of button: create a user form*/
19
+  // action of button: create a user form
19 20
   CREATE_FORM_ADD_USER = '[User] USER FORM ADD',
20 21
   CREATE_FORM_ADD_USER_SUCCESS = '[User] USER FORM ADD SUCCESS',
21 22
   CREATE_FORM_ADD_USER_ERROR = '[User] USER FORM ADD ERROR',
22 23
 
23
-  /** action of saving user data in the form */
24
+  // action of saving user data in the form
24 25
   SAVE_USERFORM_ADD = '[User] SAVE USER',
25 26
   SAVE_USERFORM_ADD_SUCCESS = '[User] SAVE USER SUCCESS',
26 27
   SAVE_USERFORM_ADD_ERROR = '[User] SAVE USER ERROR',
27 28
 
28
-  /* action: create form to edit a user */
29
+  // action: create form to edit a user
29 30
   CREATE_FORM_USER_EDIT = '[User] USER FORM EDIT',
30 31
   CREATE_FORM_USER_EDIT_SUCCESS = '[User] USER FORM EDIT SUCCESS',
31 32
   CREATE_FORM_USER_EDIT_ERROR = '[User] USER FORM EDIT ERROR',
32 33
 
33
-  /** action of updating user from user form */
34
+  // action of updating user from user form
34 35
   UPDATE_USER_FORM = '[User] USER FORM UPDATE',
35 36
   UPDATE_USER_FORM_SUCCESS = '[User] USER FORM UPDATE SUCCESS',
36 37
   UPDATE_USER_FORM_ERROR = '[User] USER FORM UPDATE ERROR',
37 38
 
38 39
 
39
-  /* action: delete a user */
40
+  // action: delete a user
40 41
   DELETE_A_USER = '[User] DELETE A USER',
41 42
   DELETE_A_USER_SUCCESS = '[User] DELETE A USER SUCCESS',
42 43
   DELETE_A_USER_ERROR = '[User] DELETE A USER ERROR',
43 44
 }
44 45
 
45
-//create actions
46
+/**create actions related to a user*/
47
+
48
+//get all users actions
46 49
 
47 50
 export class GetAllUsersAction implements Action {
48 51
   type: UserActionType = UserActionType.GET_ALL_USERS;
@@ -60,7 +63,7 @@ export class GetAllUsersActionError implements Action {
60 63
   constructor(public payload: string) {}
61 64
 }
62 65
 
63
-/* Actios of searching a user */
66
+ // Actios of searching a user
64 67
 
65 68
 export class SearchUsersAction implements Action {
66 69
   type: UserActionType = UserActionType.SEARCH_A_USER;
@@ -78,7 +81,7 @@ export class SearchUserActionError implements Action {
78 81
   constructor(public payload: string) {}
79 82
 }
80 83
 
81
-/* Actios of creating a user form to add user*/
84
+// Actios of creating a user form to add user
82 85
 
83 86
 export class CreateFormUserAddAction implements Action {
84 87
   type: UserActionType = UserActionType.CREATE_FORM_ADD_USER;
@@ -95,7 +98,7 @@ export class CreateFormUserAddActionError implements Action {
95 98
   constructor(public payload: string) {}
96 99
 }
97 100
 
98
-/**action of saving a user form data*/
101
+//actions of saving a user form data
99 102
 export class SaveUserFormAction implements Action{
100 103
   type: UserActionType = UserActionType.SAVE_USERFORM_ADD;
101 104
   constructor(public payload: User){}
@@ -111,7 +114,7 @@ export class SaveUserFormActionError implements Action{
111 114
   constructor(public payload: string){}
112 115
 }
113 116
 
114
-/* Actios of creating a user form to edit user*/
117
+// Actions of creating a user form to edit user
115 118
 
116 119
 export class CreareFormUserEditAction implements Action {
117 120
   type: UserActionType = UserActionType.CREATE_FORM_USER_EDIT;
@@ -129,7 +132,7 @@ export class CreareFormUserEditActionActionError implements Action {
129 132
   constructor(public payload: string) {}
130 133
 }
131 134
 
132
-/** action of updating user from user data form */
135
+// action of updating user from user data form
133 136
 
134 137
 export class UpdateUserFormAction implements Action{
135 138
   type: UserActionType = UserActionType.UPDATE_USER_FORM;
@@ -147,9 +150,7 @@ export class UpdateUserFormActionError implements Action{
147 150
   constructor(public payload: string){}
148 151
 }
149 152
 
150
-
151
-/* Actios of deleting a user */
152
-
153
+// Actions of deleting a user
153 154
 export class DeleteUsersAction implements Action {
154 155
   type: UserActionType = UserActionType.DELETE_A_USER;
155 156
 

Powered by TurnKey Linux.