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

Misleading docs #3

Open
noobiek opened this issue Jul 12, 2018 · 1 comment
Open

Misleading docs #3

noobiek opened this issue Jul 12, 2018 · 1 comment

Comments

@noobiek
Copy link

noobiek commented Jul 12, 2018

Hi,
I am trying to use this promising Api and face several issues. For now at least, I think connected to mistakes in docs.

For example:
1.

ApiObjectTree helper
Alternative way to avoid string api (but there are no children option):

import { ApiObjectTree } from '@apicase/services'

const api = new ApiTree(BaseService, {
getAllPosts: { url: '' },
createPost: { url: '', method: 'POST' },
getOnePost: { url: ':id', method: 'POST' },
updOnePost: { url: ':id', method: 'PUT' },
rmvOnePost: { url: ':id', method: 'DELETE' }
})

ApiObjectTree is not mentioned anywhere. Perhaps, it should be instead of ApiTree? Likewise, BaseService is not mentioned anywhere (neither in this sample, nor in previous examples), so it is unclear what it is.

  1. Then, in some examples you create ApiService passing adapter as first argument, in other examples you pass it as part of an object (with url param).
  2. Then there is ApiTree first example, where you don't pass adapter at all. But after that you say "You can also pass parent service instead of adapter" for ApiTree... where's that?

As it is, the docs are a mess, which makes it harder to use your Api. Please, clarify these points. And I'm sure there are more.

Right now I'm stuck right at the beginning:

const ApiRest = new ApiService(fetch, { url: '/api/rest/' })
var apiTableName = ApiRest.extend({ url: "table_name" })
const TableName = new ApiObjectTree(apiTableName, {
getTableName: { url: '', method: 'GET' },
}
)

TableName.getTableName.doRequest()

Guess what? This fails. :(

@Kelin2025
Copy link
Member

Kelin2025 commented Jul 12, 2018

Oh, agreed
I think there should be a "Services" section in apicase.github.io. Too many things to explain with just a README.md. I'll do it on weekends
Thank you for the issue. If you have some urgent questions, you can ask me on telegram: https://t.me/kelin2025

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

No branches or pull requests

2 participants