|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { State, Action, StateContext, Selector } from '@ngxs/store'; |
|
|
|
import { SessionSetLanguage } from '../actions/session.actions'; |
|
|
|
import { Action, Selector, State, StateContext } from '@ngxs/store'; |
|
|
|
import { SessionSetLanguage, SessionSetTenantId } from '../actions/session.actions'; |
|
|
|
import { Session } from '../models/session'; |
|
|
|
|
|
|
|
@State<Session.State>({ |
|
|
|
@ -12,6 +12,11 @@ export class SessionState { |
|
|
|
return language; |
|
|
|
} |
|
|
|
|
|
|
|
@Selector() |
|
|
|
static getSelectedTenantId({ tenantId }: Session.State): string { |
|
|
|
return tenantId; |
|
|
|
} |
|
|
|
|
|
|
|
constructor() {} |
|
|
|
|
|
|
|
@Action(SessionSetLanguage) |
|
|
|
@ -20,4 +25,11 @@ export class SessionState { |
|
|
|
language: payload, |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@Action(SessionSetTenantId) |
|
|
|
sessionSetTenantId({ patchState }: StateContext<Session.State>, { payload }: SessionSetTenantId) { |
|
|
|
patchState({ |
|
|
|
tenantId: payload, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|