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

Commit

Permalink
types(share): correct the placement of relationships in deserialize type
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 13, 2022
1 parent 3d8be45 commit 44488d4
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions shareable/types/documents/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,19 @@ export type DeserializedUnreachableEmployeesResource = DeserializedResource<
DeserializedUnreachableEmployeesAttributes
>

export type DeserializedUserResource =
export type DeserializedUserResource<
T extends UserRelationshipNames|undefined = undefined
> = (
| DeserializedStudentResource
| DeserializedReachableEmployeesResource
| DeserializedUnreachableEmployeesResource
) & PartialOrPickDeserializedRelationship<
UserRelationshipData<"read">,
DeserializedUserRelationships<"read">,
UserRelationshipNames,
T extends UserRelationshipNames ? true : false,
T extends UserRelationshipNames ? T : UserRelationshipNames
>

export type UserDocument<T extends Completeness = "read"> = ResourceDocument<
T,
Expand All @@ -176,27 +185,15 @@ export type DeserializedUserDocument<
> = DeserializedResourceDocument<
UserResourceIdentifier<"read">,
DeserializedUserAttributes,
DeserializedUserResource
> & PartialOrPickDeserializedRelationship<
UserRelationshipData<"read">,
DeserializedUserRelationships<"read">,
UserRelationshipNames,
T extends UserRelationshipNames ? true : false,
T extends UserRelationshipNames ? T : UserRelationshipNames
DeserializedUserResource<T>
>

export type DeserializedUserListDocument<
T extends UserRelationshipNames|undefined = undefined
> = DeserializedResourceListDocument<
UserResourceIdentifier<"read">,
DeserializedUserAttributes,
DeserializedUserResource
> & PartialOrPickDeserializedRelationship<
UserRelationshipData<"read">,
DeserializedUserRelationships<"read">,
UserRelationshipNames,
T extends UserRelationshipNames ? true : false,
T extends UserRelationshipNames ? T : UserRelationshipNames
DeserializedUserResource<T>
>

interface GeneralUserProfileMetaProperties extends Serializable {
Expand Down

0 comments on commit 44488d4

Please sign in to comment.