You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can’t figure out why id is required on interface IGroupSharingOptions for the getUserMembership function? id doesn't appear to be used anywhere in the code logic, and it doesn't make sense to me in the context of this method. Any insight is welcome.
The following code snippet results in a TypeScript error:
Argument of type '{ groupId: string; authentication: ArcGISIdentityManager; }' is not assignable to parameter of type 'IGroupSharingOptions'. Property 'id' is missing in type '{ groupId: string; authentication: ArcGISIdentityManager; }' but required in type 'IGroupSharingOptions'.
import{getUserMembership,IGroupSharingOptions,}from"@esri/arcgis-rest-portal";exportconstgetUserMembership_without_id=({
groupId,
authentication,}: IGroupSharingOptions)=>{returngetUserMembership({// The TypeScript error is here and described above
groupId,
authentication,});};
If id is indeed required, then what is it in the context of this getUserMembership function? The docs say:
Unique identifier for the item. Inherited from ISharingOptions.id
However, my understanding is that getUserMembership is talking about a group (and thus groupId) and not an item.
Get the User Membership for a particular group. Use this if all you have is the groupId. If you have the group object, check the userMembership.memberType property instead of calling this method.
Reproduction
// repro.ts
import {
getUserMembership,
IGroupSharingOptions,
} from "@esri/arcgis-rest-portal"; // version 4.5.0
export const getUserMembership_without_id = ({
groupId,
authentication,
}: IGroupSharingOptions) => {
return getUserMembership({
// The TypeScript error is here and described above
groupId,
authentication,
});
};
Logs
Argument of type'{ groupId: string; authentication: ArcGISIdentityManager; }' is not assignable to parameter of type'IGroupSharingOptions'. Property 'id' is missing intype'{ groupId: string; authentication: ArcGISIdentityManager; }' but required intype'IGroupSharingOptions'.
Describe the bug
I can’t figure out why
id
is required on interfaceIGroupSharingOptions
for the getUserMembership function?id
doesn't appear to be used anywhere in the code logic, and it doesn't make sense to me in the context of this method. Any insight is welcome.The following code snippet results in a TypeScript error:
If
id
is indeed required, then what is it in the context of thisgetUserMembership
function? The docs say:However, my understanding is that
getUserMembership
is talking about a group (and thusgroupId
) and not an item.Reproduction
Logs
System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: