Skip to content

Added user snippets API support#189

Merged
jdalrymple merged 5 commits into
jdalrymple:4.1from
brunobastosg:add-snippets-api
Sep 18, 2018
Merged

Added user snippets API support#189
jdalrymple merged 5 commits into
jdalrymple:4.1from
brunobastosg:add-snippets-api

Conversation

@brunobastosg

Copy link
Copy Markdown
Contributor

User snippets do not belong to a specific project and have a different API resource than the project snippets.

@jdalrymple

jdalrymple commented Sep 16, 2018

Copy link
Copy Markdown
Owner

I don't know how i missed that lol. In your PR you have a content function pointing to a raw endpoint, but i dont see that endpoint in the docs? Also you could probably combine all and allPublic and add public as an optional param like:

...
  all(options = { public: false }) {
    const { public, ...opts } = options
    const url = public ? 'snippets/public' : 'snippets';

    return RequestHelper.get(this, url, opts);
  }

To cut down on the amount of functions.

@brunobastosg

Copy link
Copy Markdown
Contributor Author

The raw endpoint is not in the docs, but it exists. For example, https://gitlab.com/snippets/1754319/raw.

I combined all and allPublic as you suggested, and also added the Snippets API to the README.

@jdalrymple

Copy link
Copy Markdown
Owner

Looks good!!

Just a couple things left!

@brunobastosg

Copy link
Copy Markdown
Contributor Author

Fixed the lint error.

I don't know if it should be added to the user bundle. There is no /users anywhere in the url. The snippets are identified only by their id.

It's up to you. If you really want it I can add it.

@jdalrymple

Copy link
Copy Markdown
Owner

That makes sense. We'll leave it out.

@jdalrymple jdalrymple added this to the 4.1 milestone Sep 18, 2018
@brunobastosg

Copy link
Copy Markdown
Contributor Author

Alright then.

Should I add some tests to fix that codecov check?

@jdalrymple

Copy link
Copy Markdown
Owner

If you have some time that would be amazing!

@jdalrymple jdalrymple changed the base branch from master to 4.1 September 18, 2018 22:37
@jdalrymple jdalrymple merged commit 11a50eb into jdalrymple:4.1 Sep 18, 2018
jdalrymple added a commit that referenced this pull request Sep 18, 2018
* chore(package): Update jest-extended to the latest version 🚀 0.9.0 (#191)
* chore(package): update lockfile package-lock.json
* feat: Re-add list all project members endpoint (#190, #141)
* feat: Adding markdown support #182 (#193)
* fixes: #188: `stream` option is lost in any `get` request that is streamable (#192)
* feat: Added user snippets API support (#189)
* chore(test): Added test for creating snippets
* feat: Added user edit support #186
@jdalrymple jdalrymple mentioned this pull request Sep 18, 2018
Merged
jdalrymple added a commit that referenced this pull request Sep 18, 2018
* chore(package): Update jest-extended to the latest version 🚀 0.9.0 (#191)
* chore(package): update lockfile package-lock.json
* feat: Re-add list all project members endpoint (#190, #141)
* feat: Adding markdown support #182 (#193)
* fixes: #188: `stream` option is lost in any `get` request that is streamable (#192)
* feat: Added user snippets API support (#189)
* chore(test): Added test for creating snippets
* feat: Added user edit support #186
@jdalrymple

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brunobastosg brunobastosg deleted the add-snippets-api branch September 22, 2018 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants