source: src/Clients/Angular/finki-chattery/src/app/core/state/category-state/category.actions.ts@ f3c4950

dev
Last change on this file since f3c4950 was f3c4950, checked in by Стојков Марко <mst@…>, 2 years ago

Moderator can create categories

  • Property mode set to 100644
File size: 1.8 KB
Line 
1import { HttpErrorResponse } from '@angular/common/http';
2import { Action } from '@ngrx/store';
3import { CategoryStateViewModel } from 'src/app/shared-app/models';
4
5export enum CategoryActionTypes {
6 GetCategoriesState = '[Category] Get state',
7 GetCategoriesStateSuccess = '[Category] Get state success',
8 AddCategory = '[Category] AddCategory',
9 AddCategorySuccess = '[Category] AddCategorySuccess success',
10 EffectStartedWorking = '[Category] Effect Started Working',
11 EffectFinishedWorking = '[Category] Effect Finished Working',
12 EffectFinishedWorkingError = '[Category] Effect Finished Working error'
13}
14
15export class GetCategoriesState implements Action {
16 readonly type = CategoryActionTypes.GetCategoriesState;
17
18 constructor() {}
19}
20
21export class GetCategoriesStateSuccess implements Action {
22 readonly type = CategoryActionTypes.GetCategoriesStateSuccess;
23
24 constructor(public payload: CategoryStateViewModel[]) {}
25}
26
27export class AddCategory implements Action {
28 readonly type = CategoryActionTypes.AddCategory;
29
30 constructor(public name: string) {}
31}
32
33export class AddCategorySuccess implements Action {
34 readonly type = CategoryActionTypes.AddCategorySuccess;
35
36 constructor(public payload: CategoryStateViewModel) {}
37}
38
39export class EffectStartedWorking implements Action {
40 readonly type = CategoryActionTypes.EffectStartedWorking;
41
42 constructor() {}
43}
44
45export class EffectFinishedWorking implements Action {
46 readonly type = CategoryActionTypes.EffectFinishedWorking;
47
48 constructor() {}
49}
50
51export class EffectFinishedWorkingError implements Action {
52 readonly type = CategoryActionTypes.EffectFinishedWorkingError;
53
54 constructor(public payload: HttpErrorResponse) {}
55}
56
57export type CategoryAction =
58 | GetCategoriesStateSuccess
59 | AddCategorySuccess
60 | EffectStartedWorking
61 | EffectFinishedWorking
62 | EffectFinishedWorkingError;
Note: See TracBrowser for help on using the repository browser.