Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit caf0a3a

Browse filesBrowse files
committed
Pagination in frontend
1 parent e1e33b1 commit caf0a3a
Copy full SHA for caf0a3a

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎typescript.json

Copy file name to clipboardExpand all lines: typescript.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"",
77
"export default class ${1/(.*)/${1:/capitalize}/}Store {",
88
" list = \\$state({})",
9-
" detail = \\$state({})",
9+
" detail = \\$state({ page: 0, perpage: 0, data: [], total: 0 })",
1010
"",
1111
" constructor(prefix) {",
1212
" this.prefix = prefix",
1313
" }",
1414
"",
15-
" fetchAll = async () => {",
15+
" fetchAll = async (page: Number = 1, perpage: Number = 10) => {",
1616
" await store.auth.refresh_token()",
17-
" const response = await methods.get(`\\${this.prefix}/${1}s`)",
17+
" const response = await methods.get(`\\${this.prefix}/${1}s`, { page, perpage })",
1818
" if (response.ok) {",
1919
" const data = await response.json()",
2020
" this.list = data",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.