From 861d028d0971b026c98f4a68881b3c37749760ee Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Jan 2022 02:26:10 +0900 Subject: [PATCH] refactor --- packages/client/src/pages/admin/abuses.vue | 2 +- packages/client/src/pages/admin/emojis.vue | 4 ++-- packages/client/src/pages/admin/files.vue | 2 +- packages/client/src/pages/admin/users.vue | 2 +- packages/client/src/pages/announcements.vue | 2 +- packages/client/src/pages/channel.vue | 2 +- packages/client/src/pages/channels.vue | 6 +++--- packages/client/src/pages/clip.vue | 2 +- packages/client/src/pages/explore.vue | 4 ++-- packages/client/src/pages/featured.vue | 2 +- packages/client/src/pages/federation.vue | 2 +- packages/client/src/pages/follow-requests.vue | 2 +- packages/client/src/pages/gallery/index.vue | 10 +++++----- packages/client/src/pages/gallery/post.vue | 2 +- packages/client/src/pages/mentions.vue | 2 +- packages/client/src/pages/messages.vue | 2 +- packages/client/src/pages/my-antennas/index.vue | 2 +- packages/client/src/pages/my-clips/index.vue | 2 +- packages/client/src/pages/my-groups/index.vue | 6 +++--- packages/client/src/pages/my-lists/index.vue | 2 +- packages/client/src/pages/note.vue | 4 ++-- packages/client/src/pages/page.vue | 2 +- packages/client/src/pages/pages.vue | 6 +++--- packages/client/src/pages/search.vue | 2 +- packages/client/src/pages/settings/apps.vue | 2 +- packages/client/src/pages/settings/mute-block.vue | 4 ++-- packages/client/src/pages/settings/security.vue | 2 +- packages/client/src/pages/tag.vue | 2 +- packages/client/src/pages/user/clips.vue | 2 +- packages/client/src/pages/user/follow-list.vue | 4 ++-- packages/client/src/pages/user/gallery.vue | 2 +- packages/client/src/pages/user/pages.vue | 2 +- packages/client/src/pages/user/reactions.vue | 2 +- packages/client/src/ui/deck/direct-column.vue | 2 +- packages/client/src/ui/deck/mentions-column.vue | 2 +- 35 files changed, 50 insertions(+), 50 deletions(-) diff --git a/packages/client/src/pages/admin/abuses.vue b/packages/client/src/pages/admin/abuses.vue index 0f19f8dbe..31cdef492 100644 --- a/packages/client/src/pages/admin/abuses.vue +++ b/packages/client/src/pages/admin/abuses.vue @@ -95,7 +95,7 @@ export default defineComponent({ reporterOrigin: 'combined', targetUserOrigin: 'combined', pagination: { - endpoint: 'admin/abuse-user-reports', + endpoint: 'admin/abuse-user-reports' as const, limit: 10, params: computed(() => ({ state: this.state, diff --git a/packages/client/src/pages/admin/emojis.vue b/packages/client/src/pages/admin/emojis.vue index 38182e5be..5b1dfe565 100644 --- a/packages/client/src/pages/admin/emojis.vue +++ b/packages/client/src/pages/admin/emojis.vue @@ -85,7 +85,7 @@ const selectMode = ref(false); const selectedEmojis = ref([]); const pagination = { - endpoint: 'admin/emoji/list', + endpoint: 'admin/emoji/list' as const, limit: 30, params: computed(() => ({ query: (query.value && query.value !== '') ? query.value : null, @@ -93,7 +93,7 @@ const pagination = { }; const remotePagination = { - endpoint: 'admin/emoji/list-remote', + endpoint: 'admin/emoji/list-remote' as const, limit: 30, params: computed(() => ({ query: (queryRemote.value && queryRemote.value !== '') ? queryRemote.value : null, diff --git a/packages/client/src/pages/admin/files.vue b/packages/client/src/pages/admin/files.vue index 10341e7e3..87dd12f48 100644 --- a/packages/client/src/pages/admin/files.vue +++ b/packages/client/src/pages/admin/files.vue @@ -95,7 +95,7 @@ export default defineComponent({ type: null, searchHost: '', pagination: { - endpoint: 'admin/drive/files', + endpoint: 'admin/drive/files' as const, limit: 10, params: computed(() => ({ type: (this.type && this.type !== '') ? this.type : null, diff --git a/packages/client/src/pages/admin/users.vue b/packages/client/src/pages/admin/users.vue index 30220a2a2..03e155ddc 100644 --- a/packages/client/src/pages/admin/users.vue +++ b/packages/client/src/pages/admin/users.vue @@ -110,7 +110,7 @@ export default defineComponent({ searchUsername: '', searchHost: '', pagination: { - endpoint: 'admin/show-users', + endpoint: 'admin/show-users' as const, limit: 10, params: computed(() => ({ sort: this.sort, diff --git a/packages/client/src/pages/announcements.vue b/packages/client/src/pages/announcements.vue index ca94640dd..53727823a 100644 --- a/packages/client/src/pages/announcements.vue +++ b/packages/client/src/pages/announcements.vue @@ -36,7 +36,7 @@ export default defineComponent({ bg: 'var(--bg)', }, pagination: { - endpoint: 'announcements', + endpoint: 'announcements' as const, limit: 10, }, }; diff --git a/packages/client/src/pages/channel.vue b/packages/client/src/pages/channel.vue index 598e173d8..c9a8f3684 100644 --- a/packages/client/src/pages/channel.vue +++ b/packages/client/src/pages/channel.vue @@ -67,7 +67,7 @@ export default defineComponent({ channel: null, showBanner: true, pagination: { - endpoint: 'channels/timeline', + endpoint: 'channels/timeline' as const, limit: 10, params: computed(() => ({ channelId: this.channelId, diff --git a/packages/client/src/pages/channels.vue b/packages/client/src/pages/channels.vue index 48877ab3e..4e538a6da 100644 --- a/packages/client/src/pages/channels.vue +++ b/packages/client/src/pages/channels.vue @@ -60,15 +60,15 @@ export default defineComponent({ })), tab: 'featured', featuredPagination: { - endpoint: 'channels/featured', + endpoint: 'channels/featured' as const, noPaging: true, }, followingPagination: { - endpoint: 'channels/followed', + endpoint: 'channels/followed' as const, limit: 5, }, ownedPagination: { - endpoint: 'channels/owned', + endpoint: 'channels/owned' as const, limit: 5, }, }; diff --git a/packages/client/src/pages/clip.vue b/packages/client/src/pages/clip.vue index b37585680..6b49221d3 100644 --- a/packages/client/src/pages/clip.vue +++ b/packages/client/src/pages/clip.vue @@ -50,7 +50,7 @@ export default defineComponent({ } : null), clip: null, pagination: { - endpoint: 'clips/notes', + endpoint: 'clips/notes' as const, limit: 10, params: computed(() => ({ clipId: this.clipId, diff --git a/packages/client/src/pages/explore.vue b/packages/client/src/pages/explore.vue index a3c3b771f..04cc3662a 100644 --- a/packages/client/src/pages/explore.vue +++ b/packages/client/src/pages/explore.vue @@ -156,7 +156,7 @@ export default defineComponent({ sort: '+createdAt', } }, searchPagination: { - endpoint: 'users/search', + endpoint: 'users/search' as const, limit: 10, params: computed(() => (this.searchQuery && this.searchQuery !== '') ? { query: this.searchQuery, @@ -178,7 +178,7 @@ export default defineComponent({ }, tagUsers(): any { return { - endpoint: 'hashtags/users', + endpoint: 'hashtags/users' as const, limit: 30, params: { tag: this.tag, diff --git a/packages/client/src/pages/featured.vue b/packages/client/src/pages/featured.vue index efa74ca59..725c70f0f 100644 --- a/packages/client/src/pages/featured.vue +++ b/packages/client/src/pages/featured.vue @@ -10,7 +10,7 @@ import * as symbols from '@/symbols'; import { i18n } from '@/i18n'; const pagination = { - endpoint: 'notes/featured', + endpoint: 'notes/featured' as const, limit: 10, offsetMode: true, }; diff --git a/packages/client/src/pages/federation.vue b/packages/client/src/pages/federation.vue index e23c4f8f1..610c9233a 100644 --- a/packages/client/src/pages/federation.vue +++ b/packages/client/src/pages/federation.vue @@ -127,7 +127,7 @@ export default defineComponent({ state: 'federating', sort: '+pubSub', pagination: { - endpoint: 'federation/instances', + endpoint: 'federation/instances' as const, limit: 10, offsetMode: true, params: computed(() => ({ diff --git a/packages/client/src/pages/follow-requests.vue b/packages/client/src/pages/follow-requests.vue index 00dfa0656..764daa0d3 100644 --- a/packages/client/src/pages/follow-requests.vue +++ b/packages/client/src/pages/follow-requests.vue @@ -42,7 +42,7 @@ import { i18n } from '@/i18n'; const paginationComponent = ref>(); const pagination = { - endpoint: 'following/requests/list', + endpoint: 'following/requests/list' as const, limit: 10, }; diff --git a/packages/client/src/pages/gallery/index.vue b/packages/client/src/pages/gallery/index.vue index cd0d2a40e..a19d69d5c 100644 --- a/packages/client/src/pages/gallery/index.vue +++ b/packages/client/src/pages/gallery/index.vue @@ -81,19 +81,19 @@ export default defineComponent({ }, tab: 'explore', recentPostsPagination: { - endpoint: 'gallery/posts', + endpoint: 'gallery/posts' as const, limit: 6, }, popularPostsPagination: { - endpoint: 'gallery/featured', + endpoint: 'gallery/featured' as const, limit: 5, }, myPostsPagination: { - endpoint: 'i/gallery/posts', + endpoint: 'i/gallery/posts' as const, limit: 5, }, likedPostsPagination: { - endpoint: 'i/gallery/likes', + endpoint: 'i/gallery/likes' as const, limit: 5, }, tags: [], @@ -106,7 +106,7 @@ export default defineComponent({ }, tagUsers(): any { return { - endpoint: 'hashtags/users', + endpoint: 'hashtags/users' as const, limit: 30, params: { tag: this.tag, diff --git a/packages/client/src/pages/gallery/post.vue b/packages/client/src/pages/gallery/post.vue index 9d769deca..fff2b6a74 100644 --- a/packages/client/src/pages/gallery/post.vue +++ b/packages/client/src/pages/gallery/post.vue @@ -93,7 +93,7 @@ export default defineComponent({ }] } : null), otherPostsPagination: { - endpoint: 'users/gallery/posts', + endpoint: 'users/gallery/posts' as const, limit: 6, params: computed(() => ({ userId: this.post.user.id diff --git a/packages/client/src/pages/mentions.vue b/packages/client/src/pages/mentions.vue index ea23c6a2f..bda56fc72 100644 --- a/packages/client/src/pages/mentions.vue +++ b/packages/client/src/pages/mentions.vue @@ -10,7 +10,7 @@ import * as symbols from '@/symbols'; import { i18n } from '@/i18n'; const pagination = { - endpoint: 'notes/mentions', + endpoint: 'notes/mentions' as const, limit: 10, }; diff --git a/packages/client/src/pages/messages.vue b/packages/client/src/pages/messages.vue index 448aa0241..8efdc5558 100644 --- a/packages/client/src/pages/messages.vue +++ b/packages/client/src/pages/messages.vue @@ -10,7 +10,7 @@ import * as symbols from '@/symbols'; import { i18n } from '@/i18n'; const pagination = { - endpoint: 'notes/mentions', + endpoint: 'notes/mentions' as const, limit: 10, params: () => ({ visibility: 'specified' diff --git a/packages/client/src/pages/my-antennas/index.vue b/packages/client/src/pages/my-antennas/index.vue index d185e796c..7138d269a 100644 --- a/packages/client/src/pages/my-antennas/index.vue +++ b/packages/client/src/pages/my-antennas/index.vue @@ -38,7 +38,7 @@ export default defineComponent({ } }, pagination: { - endpoint: 'antennas/list', + endpoint: 'antennas/list' as const, limit: 10, }, }; diff --git a/packages/client/src/pages/my-clips/index.vue b/packages/client/src/pages/my-clips/index.vue index a5bbc3fd2..ccfb9095d 100644 --- a/packages/client/src/pages/my-clips/index.vue +++ b/packages/client/src/pages/my-clips/index.vue @@ -38,7 +38,7 @@ export default defineComponent({ } }, pagination: { - endpoint: 'clips/list', + endpoint: 'clips/list' as const, limit: 10, }, draft: null, diff --git a/packages/client/src/pages/my-groups/index.vue b/packages/client/src/pages/my-groups/index.vue index db5ccde46..4b2b2963a 100644 --- a/packages/client/src/pages/my-groups/index.vue +++ b/packages/client/src/pages/my-groups/index.vue @@ -87,15 +87,15 @@ export default defineComponent({ })), tab: 'owned', ownedPagination: { - endpoint: 'users/groups/owned', + endpoint: 'users/groups/owned' as const, limit: 10, }, joinedPagination: { - endpoint: 'users/groups/joined', + endpoint: 'users/groups/joined' as const, limit: 10, }, invitationPagination: { - endpoint: 'i/user-group-invites', + endpoint: 'i/user-group-invites' as const, limit: 10, }, }; diff --git a/packages/client/src/pages/my-lists/index.vue b/packages/client/src/pages/my-lists/index.vue index 94a869b9f..1b1b7e2d0 100644 --- a/packages/client/src/pages/my-lists/index.vue +++ b/packages/client/src/pages/my-lists/index.vue @@ -40,7 +40,7 @@ export default defineComponent({ }, }, pagination: { - endpoint: 'users/lists/list', + endpoint: 'users/lists/list' as const, limit: 10, }, }; diff --git a/packages/client/src/pages/note.vue b/packages/client/src/pages/note.vue index d40082381..2249fa2b9 100644 --- a/packages/client/src/pages/note.vue +++ b/packages/client/src/pages/note.vue @@ -82,7 +82,7 @@ export default defineComponent({ showNext: false, error: null, prev: { - endpoint: 'users/notes', + endpoint: 'users/notes' as const, limit: 10, params: init => ({ userId: this.note.userId, @@ -91,7 +91,7 @@ export default defineComponent({ }, next: { reversed: true, - endpoint: 'users/notes', + endpoint: 'users/notes' as const, limit: 10, params: init => ({ userId: this.note.userId, diff --git a/packages/client/src/pages/page.vue b/packages/client/src/pages/page.vue index 5cb3948f1..429d1ddea 100644 --- a/packages/client/src/pages/page.vue +++ b/packages/client/src/pages/page.vue @@ -106,7 +106,7 @@ export default defineComponent({ page: null, error: null, otherPostsPagination: { - endpoint: 'users/pages', + endpoint: 'users/pages' as const, limit: 6, params: computed(() => ({ userId: this.page.user.id diff --git a/packages/client/src/pages/pages.vue b/packages/client/src/pages/pages.vue index f1dd64f11..dcccf7f7c 100644 --- a/packages/client/src/pages/pages.vue +++ b/packages/client/src/pages/pages.vue @@ -62,15 +62,15 @@ export default defineComponent({ })), tab: 'featured', featuredPagesPagination: { - endpoint: 'pages/featured', + endpoint: 'pages/featured' as const, noPaging: true, }, myPagesPagination: { - endpoint: 'i/pages', + endpoint: 'i/pages' as const, limit: 5, }, likedPagesPagination: { - endpoint: 'i/page-likes', + endpoint: 'i/page-likes' as const, limit: 5, }, }; diff --git a/packages/client/src/pages/search.vue b/packages/client/src/pages/search.vue index d25d5af14..ce2b7035d 100644 --- a/packages/client/src/pages/search.vue +++ b/packages/client/src/pages/search.vue @@ -18,7 +18,7 @@ const props = defineProps<{ }>(); const pagination = { - endpoint: 'notes/search', + endpoint: 'notes/search' as const, limit: 10, params: computed(() => ({ query: props.query, diff --git a/packages/client/src/pages/settings/apps.vue b/packages/client/src/pages/settings/apps.vue index a75e06165..9c0fa8a54 100644 --- a/packages/client/src/pages/settings/apps.vue +++ b/packages/client/src/pages/settings/apps.vue @@ -58,7 +58,7 @@ export default defineComponent({ bg: 'var(--bg)', }, pagination: { - endpoint: 'i/apps', + endpoint: 'i/apps' as const, limit: 100, params: { sort: '+lastUsedAt' diff --git a/packages/client/src/pages/settings/mute-block.vue b/packages/client/src/pages/settings/mute-block.vue index a4f9b41e8..903d32d08 100644 --- a/packages/client/src/pages/settings/mute-block.vue +++ b/packages/client/src/pages/settings/mute-block.vue @@ -56,11 +56,11 @@ export default defineComponent({ }, tab: 'mute', mutingPagination: { - endpoint: 'mute/list', + endpoint: 'mute/list' as const, limit: 10, }, blockingPagination: { - endpoint: 'blocking/list', + endpoint: 'blocking/list' as const, limit: 10, }, } diff --git a/packages/client/src/pages/settings/security.vue b/packages/client/src/pages/settings/security.vue index 238634002..6fb3f1c41 100644 --- a/packages/client/src/pages/settings/security.vue +++ b/packages/client/src/pages/settings/security.vue @@ -66,7 +66,7 @@ export default defineComponent({ bg: 'var(--bg)', }, pagination: { - endpoint: 'i/signin-history', + endpoint: 'i/signin-history' as const, limit: 5, }, } diff --git a/packages/client/src/pages/tag.vue b/packages/client/src/pages/tag.vue index debee2606..8d8dc0a65 100644 --- a/packages/client/src/pages/tag.vue +++ b/packages/client/src/pages/tag.vue @@ -14,7 +14,7 @@ const props = defineProps<{ }>(); const pagination = { - endpoint: 'notes/search-by-tag', + endpoint: 'notes/search-by-tag' as const, limit: 10, params: computed(() => ({ tag: props.tag, diff --git a/packages/client/src/pages/user/clips.vue b/packages/client/src/pages/user/clips.vue index aad5317ce..870e6f717 100644 --- a/packages/client/src/pages/user/clips.vue +++ b/packages/client/src/pages/user/clips.vue @@ -28,7 +28,7 @@ export default defineComponent({ data() { return { pagination: { - endpoint: 'users/clips', + endpoint: 'users/clips' as const, limit: 20, params: { userId: this.user.id, diff --git a/packages/client/src/pages/user/follow-list.vue b/packages/client/src/pages/user/follow-list.vue index e12ea477c..b34757c16 100644 --- a/packages/client/src/pages/user/follow-list.vue +++ b/packages/client/src/pages/user/follow-list.vue @@ -33,14 +33,14 @@ export default defineComponent({ data() { return { followingPagination: { - endpoint: 'users/following', + endpoint: 'users/following' as const, limit: 20, params: computed(() => ({ userId: this.user.id, })), }, followersPagination: { - endpoint: 'users/followers', + endpoint: 'users/followers' as const, limit: 20, params: computed(() => ({ userId: this.user.id, diff --git a/packages/client/src/pages/user/gallery.vue b/packages/client/src/pages/user/gallery.vue index 88f0604f1..07dda4a29 100644 --- a/packages/client/src/pages/user/gallery.vue +++ b/packages/client/src/pages/user/gallery.vue @@ -29,7 +29,7 @@ export default defineComponent({ data() { return { pagination: { - endpoint: 'users/gallery/posts', + endpoint: 'users/gallery/posts' as const, limit: 6, params: computed(() => ({ userId: this.user.id diff --git a/packages/client/src/pages/user/pages.vue b/packages/client/src/pages/user/pages.vue index 3075dd572..6ce84da0a 100644 --- a/packages/client/src/pages/user/pages.vue +++ b/packages/client/src/pages/user/pages.vue @@ -27,7 +27,7 @@ export default defineComponent({ data() { return { pagination: { - endpoint: 'users/pages', + endpoint: 'users/pages' as const, limit: 20, params: computed(() => ({ userId: this.user.id, diff --git a/packages/client/src/pages/user/reactions.vue b/packages/client/src/pages/user/reactions.vue index f51f6669c..5cb035bac 100644 --- a/packages/client/src/pages/user/reactions.vue +++ b/packages/client/src/pages/user/reactions.vue @@ -36,7 +36,7 @@ export default defineComponent({ data() { return { pagination: { - endpoint: 'users/reactions', + endpoint: 'users/reactions' as const, limit: 20, params: computed(() => ({ userId: this.user.id, diff --git a/packages/client/src/ui/deck/direct-column.vue b/packages/client/src/ui/deck/direct-column.vue index 4206b09b9..7bf634415 100644 --- a/packages/client/src/ui/deck/direct-column.vue +++ b/packages/client/src/ui/deck/direct-column.vue @@ -32,7 +32,7 @@ export default defineComponent({ data() { return { pagination: { - endpoint: 'notes/mentions', + endpoint: 'notes/mentions' as const, limit: 10, params: computed(() => ({ visibility: 'specified' diff --git a/packages/client/src/ui/deck/mentions-column.vue b/packages/client/src/ui/deck/mentions-column.vue index 4b8dc0c4e..e007b3e08 100644 --- a/packages/client/src/ui/deck/mentions-column.vue +++ b/packages/client/src/ui/deck/mentions-column.vue @@ -32,7 +32,7 @@ export default defineComponent({ data() { return { pagination: { - endpoint: 'notes/mentions', + endpoint: 'notes/mentions' as const, limit: 10, }, }