Skip to content

Commit

Permalink
Add "access" to item resource requestOptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssylvia committed Oct 2, 2018
1 parent 182ca56 commit ca1930b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/arcgis-rest-items/src/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export function addItemResource(
file: requestOptions.resource,
fileName: requestOptions.name,
text: requestOptions.content,
access: requestOptions.access,
...requestOptions.params
};

Expand Down
3 changes: 2 additions & 1 deletion packages/arcgis-rest-items/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export function updateItemResource(
requestOptions.params = {
...requestOptions.params,
fileName: requestOptions.name,
text: requestOptions.content
text: requestOptions.content,
access: requestOptions.access
};

return request(url, requestOptions);
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-items/test/add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe("search", () => {
id: "3ef",
// File() is only available in the browser
resource: file,
access: "private",
access: "inherit",
name: "thebigkahuna",
...MOCK_USER_REQOPTS
})
Expand All @@ -204,7 +204,7 @@ describe("search", () => {
expect(params.get("token")).toEqual("fake-token");
expect(params.get("f")).toEqual("json");
expect(params.get("file")).toEqual(file);
expect(params.get("access")).toEqual("private");
expect(params.get("access")).toEqual("inherit");
expect(params.get("fileName")).toEqual("thebigkahuna");
}

Expand Down

0 comments on commit ca1930b

Please sign in to comment.