Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
types: include roles and department relationships in user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 15, 2022
1 parent d9e831f commit 5067a12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common_front-end/types/independent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type {
*/
export interface DeserializedPageContext extends Serializable {
pageProps: {
userProfile: DeserializedUserProfile|null
userProfile: DeserializedUserProfile<"roles"|"department">|null
}
}

Expand Down
4 changes: 3 additions & 1 deletion shareable/types/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ type OptionalPageProps<

interface RawPageProps<T extends Format = "serialized"> extends Serializable {
// Added to pass data from server to client
userProfile: T extends "deserialized" ? DeserializedUserProfile : Serializable|null
userProfile: T extends "deserialized"
? DeserializedUserProfile<"roles"|"department">
: Serializable|null

roles: OptionalPageProps<T, DeserializedRoleListDocument>,
role: OptionalPageProps<T, DeserializedRoleDocument>
Expand Down

0 comments on commit 5067a12

Please sign in to comment.