@amityco/ts-sdk 7.5.1-c1c809a0.0 → 7.5.1-d432304.0
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/dist/@types/domains/invitation.d.ts +6 -1
- package/dist/@types/domains/invitation.d.ts.map +1 -1
- package/dist/index.cjs.js +6 -6
- package/dist/index.esm.js +6 -6
- package/dist/index.umd.js +1 -1
- package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/@types/domains/invitation.ts +5 -1
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.ts +1 -1
- package/src/utils/linkedObject/communityLinkedObject.ts +1 -0
- package/src/utils/linkedObject/invitationLinkedObject.ts +2 -2
- package/src/utils/linkedObject/joinRequestLinkedObject.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,SAgDhF,CAAC"}
|
package/package.json
CHANGED
|
@@ -33,6 +33,9 @@ declare global {
|
|
|
33
33
|
|
|
34
34
|
type InvitationSortBy = InvitationSortByEnum;
|
|
35
35
|
|
|
36
|
+
type InvitationDomain<T extends Amity.InvitationTargetType = Amity.InvitationTargetType> =
|
|
37
|
+
T extends 'community' ? { communityId: string } : { communityId?: string };
|
|
38
|
+
|
|
36
39
|
type RawInvitation = {
|
|
37
40
|
_id: string;
|
|
38
41
|
networkId: string;
|
|
@@ -50,7 +53,8 @@ declare global {
|
|
|
50
53
|
inviterUserId: string;
|
|
51
54
|
inviterUserInternalId: string;
|
|
52
55
|
inviterUserPublicId: string;
|
|
53
|
-
} & Amity.Timestamps
|
|
56
|
+
} & Amity.Timestamps &
|
|
57
|
+
Amity.InvitationDomain<Amity.InvitationTargetType>;
|
|
54
58
|
|
|
55
59
|
type InternalInvitation = Omit<RawInvitation, 'createdBy'> & {
|
|
56
60
|
createdById: string;
|
package/src/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.ts
CHANGED
|
@@ -15,7 +15,7 @@ export class MyInvitationsPaginationController extends PaginationController<
|
|
|
15
15
|
{ params: { ...params, options } },
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
await getCommunityByIds(data.invitations.map(invitation => invitation.
|
|
18
|
+
await getCommunityByIds(data.invitations.map(invitation => invitation.communityId));
|
|
19
19
|
|
|
20
20
|
return data;
|
|
21
21
|
}
|
|
@@ -36,6 +36,7 @@ export const communityLinkedObject = (community: Amity.InternalCommunity): Amity
|
|
|
36
36
|
return data;
|
|
37
37
|
},
|
|
38
38
|
join: async () => joinRequest(community.communityId),
|
|
39
|
+
|
|
39
40
|
getJoinRequests: (
|
|
40
41
|
params: Omit<Amity.QueryJoinRequest, 'communityId'>,
|
|
41
42
|
callback: Amity.LiveCollectionCallback<Amity.JoinRequest>,
|
|
@@ -28,10 +28,10 @@ export const invitationLinkedObject = (invitation: Amity.InternalInvitation): Am
|
|
|
28
28
|
return undefined;
|
|
29
29
|
},
|
|
30
30
|
accept: async () => {
|
|
31
|
-
acceptInvitation(invitation._id);
|
|
31
|
+
await acceptInvitation(invitation._id);
|
|
32
32
|
},
|
|
33
33
|
reject: async () => {
|
|
34
|
-
rejectInvitation(invitation._id);
|
|
34
|
+
await rejectInvitation(invitation._id);
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
};
|
|
@@ -19,13 +19,13 @@ export const joinRequestLinkedObject = (
|
|
|
19
19
|
return userLinkedObject(user);
|
|
20
20
|
},
|
|
21
21
|
cancel: async () => {
|
|
22
|
-
cancelJoinRequest(joinRequest);
|
|
22
|
+
await cancelJoinRequest(joinRequest);
|
|
23
23
|
},
|
|
24
24
|
approve: async () => {
|
|
25
|
-
approveJoinRequest(joinRequest);
|
|
25
|
+
await approveJoinRequest(joinRequest);
|
|
26
26
|
},
|
|
27
27
|
reject: async () => {
|
|
28
|
-
rejectJoinRequest(joinRequest);
|
|
28
|
+
await rejectJoinRequest(joinRequest);
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
};
|