Skip to content

Commit

Permalink
Merge pull request #3105 from bcameron1231/fix/3091
Browse files Browse the repository at this point in the history
Fixes 3091
  • Loading branch information
juliemturner authored Aug 12, 2024
2 parents 75b5592 + 123b6e8 commit 3b7cc83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/graph/shares.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const shareLinkInfo = {
encodedSharingUrl: shareLink,
redeemSharingLink: false
};
// default shared drive item response (id, name)
const sharedDriveItem = await graph.shares.useSharingLink(shareLinkInfo);

```

## Create Sharing Link
Expand Down
4 changes: 2 additions & 2 deletions packages/graph/shares/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class _Shares extends _GraphCollection<IPermissionType[]> {
* @param share: string - Share Id or Encoded Sharing Url
* @returns Microsoft Graph - SharingLink
*/
public async useSharingLink(shareLink: IShareLinkInfo): Promise<ISharedDriveItemType> {
public async useSharingLink(shareLink: IShareLinkInfo): Promise<Pick<ISharedDriveItemType, "id"|"name">> {
const q = Shares(this, shareLink.shareId || shareLink.encodedSharingUrl);
if (shareLink.redeemSharingLink) {
q.using(InjectHeaders({
Expand All @@ -60,7 +60,7 @@ export class _Shares extends _GraphCollection<IPermissionType[]> {
return graphPost(q, body(shareLinkAccess));
}
}
export interface IShares extends _Shares, IGetById<ISharedDriveItemType> { }
export interface IShares extends _Shares, IGetById<IShare> { }
export const Shares = graphInvokableFactory<IShares>(_Shares);


Expand Down

0 comments on commit 3b7cc83

Please sign in to comment.