member_webapp/@overflow/shared/auth/store/auth/auth.action.ts
crusader 46c1c55d61 ing
2018-06-01 18:45:28 +09:00

47 lines
1.2 KiB
TypeScript

import { Action } from '@ngrx/store';
import { RESTClientError } from '@loafer/ng-rest';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { Member } from '@overflow/commons-typescript/model/member';
export enum ActionType {
SigninSuccess = '[auth.auth] SigninSuccess',
SigninCookieSuccess = '[auth.auth] SigninCookieSuccess',
SignoutSuccess = '[auth.auth] SignoutSuccess',
ModifySuccess = '[auth.auth] ModifySuccess',
}
export class SigninSuccess implements Action {
readonly type = ActionType.SigninSuccess;
constructor(public payload: {authToken: string, domainMember: DomainMember, returnURL: string}) {}
}
export class SigninCookieSuccess implements Action {
readonly type = ActionType.SigninCookieSuccess;
constructor(public payload: {domainMember: DomainMember, returnURL: string}) {}
}
export class SignoutSuccess implements Action {
readonly type = ActionType.SignoutSuccess;
}
export class ModifySuccess implements Action {
readonly type = ActionType.ModifySuccess;
constructor(public payload: Member) {}
}
export type Actions =
| SigninSuccess
| SigninCookieSuccess
| SignoutSuccess
| ModifySuccess
;