@campxdev/shared 1.11.24 → 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
|
@@ -4,6 +4,16 @@ export const batchOptions = Array.from({ length: 12 }, (_, i) => {
|
|
|
4
4
|
return `${2012 + i} - ${2012 + i + 1}`
|
|
5
5
|
}).reverse()
|
|
6
6
|
|
|
7
|
+
export const getYears = () => {
|
|
8
|
+
const start = 2019
|
|
9
|
+
const end = new Date().getFullYear() + 3
|
|
10
|
+
const values = new Array(end - start).fill(0).map((_, i) => ({
|
|
11
|
+
label: `${start + i}`,
|
|
12
|
+
value: `${start + i}`,
|
|
13
|
+
}))
|
|
14
|
+
return values.reverse()
|
|
15
|
+
}
|
|
16
|
+
|
|
7
17
|
export const examGroupBatches = Array.from({ length: 10 }, (_, i) => {
|
|
8
18
|
return `${2012 + i} - ${2012 + i + 1}`
|
|
9
19
|
})
|
package/src/hooks/useAuth.ts
CHANGED
|
@@ -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
|
})
|