[skip ci] added docs for new features
This commit is contained in:
parent
4ec47066eb
commit
f84d61916e
|
@ -1,2 +1,22 @@
|
||||||
# Add a new api endpoint/feature
|
# Add a new api endpoint/feature
|
||||||
|
|
||||||
|
Most of the api endpoints/features of Vikunja are using the [common web handler](https://code.vikunja.io/web).
|
||||||
|
This is a library created by Vikunja in an effort to facilitate the creation of REST endpoints.
|
||||||
|
|
||||||
|
This works by abstracting the handling of CRUD-Requests, including rights check.
|
||||||
|
|
||||||
|
You can learn more about the web handler on [the project's repo](https://code.vikunja.io/web).
|
||||||
|
|
||||||
|
### Helper for pagination
|
||||||
|
|
||||||
|
These can be calculated in combination with a helper function, `getLimitFromPageIndex(pageIndex)` which returns
|
||||||
|
the `limit` (max-length) and `offset` parameters needed for SQL-Queries.
|
||||||
|
|
||||||
|
You can feed this function directly into xorm's `Limit`-Function like so:
|
||||||
|
|
||||||
|
```go
|
||||||
|
lists := []List{}
|
||||||
|
err := x.Limit(getLimitFromPageIndex(pageIndex)).Find(&lists)
|
||||||
|
```
|
||||||
|
|
||||||
|
// TODO: Add a full example from start to finish, like a tutorial on how to create a new endpoint.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user