Skip to content

Commit

Permalink
fix(updateItemResources): support item resource prefix
Browse files Browse the repository at this point in the history
AFFECTS PACKAGES:
@esri/arcgis-rest-portal

ISSUES CLOSED: #824
  • Loading branch information
thollingshead committed Apr 12, 2021
1 parent a6eafac commit 98be7a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/arcgis-rest-portal/src/items/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export function updateItemResource(
requestOptions.params = {
file: requestOptions.resource,
fileName: requestOptions.name,
resourcesPrefix: requestOptions.prefix,
text: requestOptions.content,
...requestOptions.params
};
Expand Down
6 changes: 4 additions & 2 deletions packages/arcgis-rest-portal/test/items/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ describe("search", () => {
updateItemResource({
id: "3ef",
owner: "dbouwman",
name: "image/banner.png",
name: "banner.png",
prefix: "image",
content: "jumbotron",
...MOCK_USER_REQOPTS
})
Expand All @@ -267,7 +268,8 @@ describe("search", () => {
const params = options.body as FormData;
if (params.get) {
expect(params.get("f")).toEqual("json");
expect(params.get("fileName")).toEqual("image/banner.png");
expect(params.get("fileName")).toEqual("banner.png");
expect(params.get("resourcesPrefix")).toEqual("image");
expect(params.get("text")).toEqual("jumbotron");
expect(params.get("access")).toEqual(null);
expect(params.get("token")).toEqual("fake-token");
Expand Down

0 comments on commit 98be7a7

Please sign in to comment.