From 1304dfa53cb62447a57b12edd7bbadfbe57c87f2 Mon Sep 17 00:00:00 2001 From: Tomi Tavela Date: Sun, 6 Aug 2023 11:02:20 +0300 Subject: [PATCH] Update calling-other-endpoints.md fixed import and usage of AssignFrom --- docs/concepts/calling-other-endpoints.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/concepts/calling-other-endpoints.md b/docs/concepts/calling-other-endpoints.md index b3bd957ac..f7ccf2156 100644 --- a/docs/concepts/calling-other-endpoints.md +++ b/docs/concepts/calling-other-endpoints.md @@ -29,9 +29,10 @@ The second method essentially starts from scratch where the user constructs the ```TypeScript import { spfi } from "@pnp/sp"; +import { AssignFrom } from "@pnp/core"; import "@pnp/sp/webs"; import "@pnp/sp/lists"; -import { spGet, SPQueryable, SPFx, AssignFrom } from "@pnp/sp"; +import { spGet, SPQueryable, SPFx } from "@pnp/sp"; // Establish SPFI instance passing in the appropriate behavior to register the initial observers. const sp = spfi(...); @@ -49,7 +50,7 @@ const spQueryable = SPQueryable("https://contoso.sharepoint.com/sites/testsite/_ // ***or*** // For v3 the full url is require for SPQuerable when providing just a string -const spQueryable = SPQueryable("https://contoso.sharepoint.com/sites/testsite/_api/web/lists/getByTitle('My List')/items(1)").using(AssignFrom(sp)); +const spQueryable = SPQueryable("https://contoso.sharepoint.com/sites/testsite/_api/web/lists/getByTitle('My List')/items(1)").using(AssignFrom(sp.web)); // and then use spQueryable to make the request const item: any = await spGet(spQueryable);