@campxdev/shared 1.11.25 → 1.11.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.11.25",
3
+ "version": "1.11.26",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -232,6 +232,9 @@ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
232
232
  s.institutionType = res.data?.institutionType
233
233
  s.masterInstitutionUniqueId = res.data?.masterInstitutionUniqueId
234
234
  s.masterInstitutionId = res.data?.masterInstitutionId
235
+ s.isMasterInstitutionUser = res.data?.institutions
236
+ ?.map((institution) => institution?.id)
237
+ ?.includes(res?.data?.masterInstitutionUniqueId)
235
238
  })
236
239
  AssetsStore.update((s) => {
237
240
  s.logo = res.data?.assets.logo
@@ -2045,6 +2045,8 @@ interface IPermissionsStore {
2045
2045
  institutionType: 'MASTER_CHILD' | 'INDIVIDUAL'
2046
2046
  masterInstitutionUniqueId?: number
2047
2047
  masterInstitutionId?: string
2048
+ isMasterInstitution: boolean
2049
+ isMasterInstitutionUser?: boolean
2048
2050
  }
2049
2051
 
2050
2052
  export const PermissionsStore = new Store<IPermissionsStore>({
@@ -2053,4 +2055,6 @@ export const PermissionsStore = new Store<IPermissionsStore>({
2053
2055
  institutionType: null,
2054
2056
  masterInstitutionUniqueId: null,
2055
2057
  masterInstitutionId: null,
2058
+ isMasterInstitution: false,
2059
+ isMasterInstitutionUser: false,
2056
2060
  })