Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent handling of owner property in item functions #247

Closed
noahmulfinger opened this issue Jul 17, 2018 · 1 comment
Closed

Inconsistent handling of owner property in item functions #247

noahmulfinger opened this issue Jul 17, 2018 · 1 comment
Assignees

Comments

@noahmulfinger
Copy link
Contributor

noahmulfinger commented Jul 17, 2018

A lot of the functions in items.ts use different methods for getting the owner property used for creating the correct url. It would be great if we could standardize this as much as possible. Some examples below:

In the updateItem function:

const url = `${getPortalUrl(requestOptions)}/content/users/${
    requestOptions.item.owner
}/items/${requestOptions.item.id}/update`;

In the updateItemResources function:

const owner = requestOptions.owner || requestOptions.authentication.username;
const url = `${getPortalUrl(requestOptions)}/content/users/${owner}/items/${
    requestOptions.id
}/updateResources`;

In the createItemInFolder function:

const owner =
    requestOptions.owner ||
    requestOptions.item.owner ||
    requestOptions.authentication.username;
const baseUrl = `${getPortalUrl(requestOptions)}/content/users/${owner}`;
let url = `${baseUrl}/addItem`;
@jgravois
Copy link
Contributor

resolved in #248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants