Browse Source

commit modification

placidenduwayo 2 years ago
parent
commit
d9027b2718
1 changed files with 18 additions and 17 deletions
  1. 18
    17
      src/app/ngrx/users/users.actions.ts

+ 18
- 17
src/app/ngrx/users/users.actions.ts View File

1
 import { Action } from '@ngrx/store';
1
 import { Action } from '@ngrx/store';
2
 import { User } from 'src/app/shared/models/user.model';
2
 import { User } from 'src/app/shared/models/user.model';
3
 
3
 
4
-//type of actions
4
+/**type of actions*/
5
 
5
 
6
 export enum UserActionType {
6
 export enum UserActionType {
7
-  /* action: get all users */
7
+
8
+  // action: get all users
8
   GET_ALL_USERS = '[User] GET ALL USERS',
9
   GET_ALL_USERS = '[User] GET ALL USERS',
9
   GET_ALL_USERS_SUCCESS = '[User] GET-ALL USERS SUCCESS',
10
   GET_ALL_USERS_SUCCESS = '[User] GET-ALL USERS SUCCESS',
10
   GET_ALL_USERS_ERROR = '[User] GET-ALL USERS ERROR',
11
   GET_ALL_USERS_ERROR = '[User] GET-ALL USERS ERROR',
11
 
12
 
12
-  /* action: search a user */
13
+  // action: search a user
13
   SEARCH_A_USER = '[User] SEARCH A USER',
14
   SEARCH_A_USER = '[User] SEARCH A USER',
14
   SEARCH_A_USER_SUCCESS = '[User] SEARCH A USER SUCCESS',
15
   SEARCH_A_USER_SUCCESS = '[User] SEARCH A USER SUCCESS',
15
   SEARCH_A_USER_ERROR = '[User] SEARCH A USER ERROR',
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
   CREATE_FORM_ADD_USER = '[User] USER FORM ADD',
20
   CREATE_FORM_ADD_USER = '[User] USER FORM ADD',
20
   CREATE_FORM_ADD_USER_SUCCESS = '[User] USER FORM ADD SUCCESS',
21
   CREATE_FORM_ADD_USER_SUCCESS = '[User] USER FORM ADD SUCCESS',
21
   CREATE_FORM_ADD_USER_ERROR = '[User] USER FORM ADD ERROR',
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
   SAVE_USERFORM_ADD = '[User] SAVE USER',
25
   SAVE_USERFORM_ADD = '[User] SAVE USER',
25
   SAVE_USERFORM_ADD_SUCCESS = '[User] SAVE USER SUCCESS',
26
   SAVE_USERFORM_ADD_SUCCESS = '[User] SAVE USER SUCCESS',
26
   SAVE_USERFORM_ADD_ERROR = '[User] SAVE USER ERROR',
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
   CREATE_FORM_USER_EDIT = '[User] USER FORM EDIT',
30
   CREATE_FORM_USER_EDIT = '[User] USER FORM EDIT',
30
   CREATE_FORM_USER_EDIT_SUCCESS = '[User] USER FORM EDIT SUCCESS',
31
   CREATE_FORM_USER_EDIT_SUCCESS = '[User] USER FORM EDIT SUCCESS',
31
   CREATE_FORM_USER_EDIT_ERROR = '[User] USER FORM EDIT ERROR',
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
   UPDATE_USER_FORM = '[User] USER FORM UPDATE',
35
   UPDATE_USER_FORM = '[User] USER FORM UPDATE',
35
   UPDATE_USER_FORM_SUCCESS = '[User] USER FORM UPDATE SUCCESS',
36
   UPDATE_USER_FORM_SUCCESS = '[User] USER FORM UPDATE SUCCESS',
36
   UPDATE_USER_FORM_ERROR = '[User] USER FORM UPDATE ERROR',
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
   DELETE_A_USER = '[User] DELETE A USER',
41
   DELETE_A_USER = '[User] DELETE A USER',
41
   DELETE_A_USER_SUCCESS = '[User] DELETE A USER SUCCESS',
42
   DELETE_A_USER_SUCCESS = '[User] DELETE A USER SUCCESS',
42
   DELETE_A_USER_ERROR = '[User] DELETE A USER ERROR',
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
 export class GetAllUsersAction implements Action {
50
 export class GetAllUsersAction implements Action {
48
   type: UserActionType = UserActionType.GET_ALL_USERS;
51
   type: UserActionType = UserActionType.GET_ALL_USERS;
60
   constructor(public payload: string) {}
63
   constructor(public payload: string) {}
61
 }
64
 }
62
 
65
 
63
-/* Actios of searching a user */
66
+ // Actios of searching a user
64
 
67
 
65
 export class SearchUsersAction implements Action {
68
 export class SearchUsersAction implements Action {
66
   type: UserActionType = UserActionType.SEARCH_A_USER;
69
   type: UserActionType = UserActionType.SEARCH_A_USER;
78
   constructor(public payload: string) {}
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
 export class CreateFormUserAddAction implements Action {
86
 export class CreateFormUserAddAction implements Action {
84
   type: UserActionType = UserActionType.CREATE_FORM_ADD_USER;
87
   type: UserActionType = UserActionType.CREATE_FORM_ADD_USER;
95
   constructor(public payload: string) {}
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
 export class SaveUserFormAction implements Action{
102
 export class SaveUserFormAction implements Action{
100
   type: UserActionType = UserActionType.SAVE_USERFORM_ADD;
103
   type: UserActionType = UserActionType.SAVE_USERFORM_ADD;
101
   constructor(public payload: User){}
104
   constructor(public payload: User){}
111
   constructor(public payload: string){}
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
 export class CreareFormUserEditAction implements Action {
119
 export class CreareFormUserEditAction implements Action {
117
   type: UserActionType = UserActionType.CREATE_FORM_USER_EDIT;
120
   type: UserActionType = UserActionType.CREATE_FORM_USER_EDIT;
129
   constructor(public payload: string) {}
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
 export class UpdateUserFormAction implements Action{
137
 export class UpdateUserFormAction implements Action{
135
   type: UserActionType = UserActionType.UPDATE_USER_FORM;
138
   type: UserActionType = UserActionType.UPDATE_USER_FORM;
147
   constructor(public payload: string){}
150
   constructor(public payload: string){}
148
 }
151
 }
149
 
152
 
150
-
151
-/* Actios of deleting a user */
152
-
153
+// Actions of deleting a user
153
 export class DeleteUsersAction implements Action {
154
 export class DeleteUsersAction implements Action {
154
   type: UserActionType = UserActionType.DELETE_A_USER;
155
   type: UserActionType = UserActionType.DELETE_A_USER;
155
 
156
 

Powered by TurnKey Linux.