This commit is contained in:
crusader 2018-05-24 20:03:23 +09:00
parent 3af1550821
commit 7852cd0081
5 changed files with 36 additions and 36 deletions

View File

@ -41,7 +41,7 @@ export class NoAuthProbeListContainerComponent implements OnInit, AfterContentIn
ngAfterContentInit() {
this.store.select(AuthSelector.select('domain')).subscribe(
(domain: Domain) => {
this.store.dispatch(new ListStore.ReadAllByDomain(domain));
this.store.dispatch(new ListStore.ReadAllByDomainID(domain.id));
}
);
}

View File

@ -19,15 +19,15 @@ export class NoAuthProbeService {
}
public readAllByDomain(domain: Domain): Observable<NoAuthProbe[]> {
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.readAllByDomain', domain);
public readAllByDomainID(domainID: number): Observable<NoAuthProbe[]> {
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.readAllByDomainID', domainID);
}
public acceptNoAuthProbe(noAuthProbe: NoAuthProbe): Observable<NoAuthProbe[]> {
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.acceptNoAuthProbe', noAuthProbe);
public acceptNoAuthProbe(noAuthProbeID: number): Observable<NoAuthProbe[]> {
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.acceptNoAuthProbe', noAuthProbeID);
}
public denyNoauthProbe(noAuthProbe: NoAuthProbe): Observable<NoAuthProbe[]> {
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.denyNoauthProbe', noAuthProbe);
public denyNoauthProbe(noAuthProbeID: number): Observable<NoAuthProbe[]> {
return this.rpcService.call<NoAuthProbe[]>('NoAuthProbeService.denyNoauthProbe', noAuthProbeID);
}
}

View File

@ -7,9 +7,9 @@ import { Domain } from '@overflow/commons-typescript/model/domain';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
export enum ActionType {
ReadAllByDomain = '[noauth-proboe.noauth-proboe] ReadAllByDomain',
ReadAllByDomainSuccess = '[noauth-proboe.noauth-proboe] ReadAllByDomainSuccess',
ReadAllByDomainFailure = '[noauth-proboe.noauth-proboe] ReadAllByDomainFailure',
ReadAllByDomainID = '[noauth-proboe.noauth-proboe] ReadAllByDomainID',
ReadAllByDomainIDSuccess = '[noauth-proboe.noauth-proboe] ReadAllByDomainIDSuccess',
ReadAllByDomainIDFailure = '[noauth-proboe.noauth-proboe] ReadAllByDomainIDFailure',
Accept = '[noauth-proboe.noauth-proboe] Accept',
AcceptSuccess = '[noauth-proboe.noauth-proboe] AcceptSuccess',
@ -23,20 +23,20 @@ export enum ActionType {
OnDisconnect = '[noauth-proboe.noauth-proboe] OnDisconnect',
}
export class ReadAllByDomain implements Action {
readonly type = ActionType.ReadAllByDomain;
export class ReadAllByDomainID implements Action {
readonly type = ActionType.ReadAllByDomainID;
constructor(public payload: Domain) {}
constructor(public payload: number) {}
}
export class ReadAllByDomainSuccess implements Action {
readonly type = ActionType.ReadAllByDomainSuccess;
export class ReadAllByDomainIDSuccess implements Action {
readonly type = ActionType.ReadAllByDomainIDSuccess;
constructor(public payload: NoAuthProbe[]) {}
}
export class ReadAllByDomainFailure implements Action {
readonly type = ActionType.ReadAllByDomainFailure;
export class ReadAllByDomainIDFailure implements Action {
readonly type = ActionType.ReadAllByDomainIDFailure;
constructor(public payload: RPCClientError) {}
}
@ -44,7 +44,7 @@ export class ReadAllByDomainFailure implements Action {
export class Accept implements Action {
readonly type = ActionType.Accept;
constructor(public payload: NoAuthProbe) {}
constructor(public payload: number) {}
}
export class AcceptSuccess implements Action {
@ -62,7 +62,7 @@ export class AcceptFailure implements Action {
export class Deny implements Action {
readonly type = ActionType.Deny;
constructor(public payload: NoAuthProbe) {}
constructor(public payload: number) {}
}
export class DenySuccess implements Action {
@ -91,9 +91,9 @@ export class OnDisconnect implements Action {
export type Actions =
| ReadAllByDomain
| ReadAllByDomainSuccess
| ReadAllByDomainFailure
| ReadAllByDomainID
| ReadAllByDomainIDSuccess
| ReadAllByDomainIDFailure
| Accept
| AcceptSuccess
| AcceptFailure

View File

@ -22,9 +22,9 @@ import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
import { NoAuthProbeService } from '../../service/noauth-probe.service';
import {
ReadAllByDomain,
ReadAllByDomainFailure,
ReadAllByDomainSuccess,
ReadAllByDomainID,
ReadAllByDomainIDFailure,
ReadAllByDomainIDSuccess,
Accept,
AcceptSuccess,
AcceptFailure,
@ -45,14 +45,14 @@ export class Effects {
@Effect()
readAllByDomain$: Observable<Action> = this.actions$
.ofType(ActionType.ReadAllByDomain)
.map((action: ReadAllByDomain) => action.payload)
.switchMap(payload => this.noAuthProbeService.readAllByDomain(payload))
.ofType(ActionType.ReadAllByDomainID)
.map((action: ReadAllByDomainID) => action.payload)
.switchMap(payload => this.noAuthProbeService.readAllByDomainID(payload))
.map(noAuthProbes => {
return new ReadAllByDomainSuccess(noAuthProbes);
return new ReadAllByDomainIDSuccess(noAuthProbes);
})
.catch((error: RPCClientError) => {
return of(new ReadAllByDomainFailure(error));
return of(new ReadAllByDomainIDFailure(error));
});
@Effect()

View File

@ -1,7 +1,7 @@
import {
ReadAllByDomain,
ReadAllByDomainFailure,
ReadAllByDomainSuccess,
ReadAllByDomainID,
ReadAllByDomainIDFailure,
ReadAllByDomainIDSuccess,
Accept,
AcceptSuccess,
AcceptFailure,
@ -21,7 +21,7 @@ import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.ReadAllByDomain: {
case ActionType.ReadAllByDomainID: {
return {
...state,
error: null,
@ -29,7 +29,7 @@ export function reducer(state = initialState, action: Actions): State {
};
}
case ActionType.ReadAllByDomainSuccess: {
case ActionType.ReadAllByDomainIDSuccess: {
return {
...state,
error: null,
@ -38,7 +38,7 @@ export function reducer(state = initialState, action: Actions): State {
};
}
case ActionType.ReadAllByDomainFailure: {
case ActionType.ReadAllByDomainIDFailure: {
return {
...state,
error: action.payload,