Browse Source

refactor(core): change state service dispatcher parameters

pull/2431/head
TheDiaval 7 years ago
parent
commit
d30f5a7af6
  1. 8
      npm/ng-packs/packages/core/src/lib/services/config-state.service.ts
  2. 8
      npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts
  3. 8
      npm/ng-packs/packages/core/src/lib/services/session-state.service.ts

8
npm/ng-packs/packages/core/src/lib/services/config-state.service.ts

@ -54,11 +54,11 @@ export class ConfigStateService {
return this.store.dispatch(new GetAppConfiguration());
}
dispatchPatchRouteByName(name: string, newValue: Partial<ABP.Route>) {
return this.store.dispatch(new PatchRouteByName(name, newValue));
dispatchPatchRouteByName(...args: ConstructorParameters<typeof PatchRouteByName>) {
return this.store.dispatch(new PatchRouteByName(...args));
}
dispatchAddRoute(payload: Omit<ABP.Route, 'children'>) {
return this.store.dispatch(new AddRoute(payload));
dispatchAddRoute(...args: ConstructorParameters<typeof AddRoute>) {
return this.store.dispatch(new AddRoute(...args));
}
}

8
npm/ng-packs/packages/core/src/lib/services/profile-state.service.ts

@ -18,11 +18,11 @@ export class ProfileStateService {
return this.store.dispatch(new GetProfile());
}
dispatchUpdateProfile(payload: Profile.Response) {
return this.store.dispatch(new UpdateProfile(payload));
dispatchUpdateProfile(...args: ConstructorParameters<typeof UpdateProfile>) {
return this.store.dispatch(new UpdateProfile(...args));
}
dispatchChangePassword(payload: Profile.ChangePasswordRequest) {
return this.store.dispatch(new ChangePassword(payload));
dispatchChangePassword(...args: ConstructorParameters<typeof ChangePassword>) {
return this.store.dispatch(new ChangePassword(...args));
}
}

8
npm/ng-packs/packages/core/src/lib/services/session-state.service.ts

@ -18,11 +18,11 @@ export class SessionStateService {
return this.store.selectSnapshot(SessionState.getTenant);
}
dispatchSetLanguage(payload: string) {
return this.store.dispatch(new SetLanguage(payload));
dispatchSetLanguage(...args: ConstructorParameters<typeof SetLanguage>) {
return this.store.dispatch(new SetLanguage(...args));
}
dispatchSetTenant(payload: ABP.BasicItem) {
return this.store.dispatch(new SetTenant(payload));
dispatchSetTenant(...args: ConstructorParameters<typeof SetTenant>) {
return this.store.dispatch(new SetTenant(...args));
}
}

Loading…
Cancel
Save