pagination update
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getArticles({page = 0, size = 10, q = ''}, authorization) {
|
getArticles({page, size, q = ''}, authorization) {
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
url: '/api/articles',
|
url: '/api/articles',
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class ArticleRepository {
|
|||||||
|
|
||||||
return em.createNamedQuery("findAll", Article.class)
|
return em.createNamedQuery("findAll", Article.class)
|
||||||
.setFirstResult(page * size)
|
.setFirstResult(page * size)
|
||||||
.setMaxResults(page * size + size)
|
.setMaxResults(size)
|
||||||
.getResultList();
|
.getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user