refactor
This commit is contained in:
		
							parent
							
								
									f96d50bc07
								
							
						
					
					
						commit
						861d028d09
					
				
					 35 changed files with 50 additions and 50 deletions
				
			
		|  | @ -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, | ||||
|  |  | |||
|  | @ -85,7 +85,7 @@ const selectMode = ref(false); | |||
| const selectedEmojis = ref<string[]>([]); | ||||
| 
 | ||||
| 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, | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -36,7 +36,7 @@ export default defineComponent({ | |||
| 				bg: 'var(--bg)', | ||||
| 			}, | ||||
| 			pagination: { | ||||
| 				endpoint: 'announcements', | ||||
| 				endpoint: 'announcements' as const, | ||||
| 				limit: 10, | ||||
| 			}, | ||||
| 		}; | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
| 			}, | ||||
| 		}; | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
| }; | ||||
|  |  | |||
|  | @ -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(() => ({ | ||||
|  |  | |||
|  | @ -42,7 +42,7 @@ import { i18n } from '@/i18n'; | |||
| const paginationComponent = ref<InstanceType<typeof MkPagination>>(); | ||||
| 
 | ||||
| const pagination = { | ||||
| 	endpoint: 'following/requests/list', | ||||
| 	endpoint: 'following/requests/list' as const, | ||||
| 	limit: 10, | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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, | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -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' | ||||
|  |  | |||
|  | @ -38,7 +38,7 @@ export default defineComponent({ | |||
| 				} | ||||
| 			}, | ||||
| 			pagination: { | ||||
| 				endpoint: 'antennas/list', | ||||
| 				endpoint: 'antennas/list' as const, | ||||
| 				limit: 10, | ||||
| 			}, | ||||
| 		}; | ||||
|  |  | |||
|  | @ -38,7 +38,7 @@ export default defineComponent({ | |||
| 				} | ||||
| 			}, | ||||
| 			pagination: { | ||||
| 				endpoint: 'clips/list', | ||||
| 				endpoint: 'clips/list' as const, | ||||
| 				limit: 10, | ||||
| 			}, | ||||
| 			draft: null, | ||||
|  |  | |||
|  | @ -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, | ||||
| 			}, | ||||
| 		}; | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ export default defineComponent({ | |||
| 				}, | ||||
| 			}, | ||||
| 			pagination: { | ||||
| 				endpoint: 'users/lists/list', | ||||
| 				endpoint: 'users/lists/list' as const, | ||||
| 				limit: 10, | ||||
| 			}, | ||||
| 		}; | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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, | ||||
| 			}, | ||||
| 		}; | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ const props = defineProps<{ | |||
| }>(); | ||||
| 
 | ||||
| const pagination = { | ||||
| 	endpoint: 'notes/search', | ||||
| 	endpoint: 'notes/search' as const, | ||||
| 	limit: 10, | ||||
| 	params: computed(() => ({ | ||||
| 		query: props.query, | ||||
|  |  | |||
|  | @ -58,7 +58,7 @@ export default defineComponent({ | |||
| 				bg: 'var(--bg)', | ||||
| 			}, | ||||
| 			pagination: { | ||||
| 				endpoint: 'i/apps', | ||||
| 				endpoint: 'i/apps' as const, | ||||
| 				limit: 100, | ||||
| 				params: { | ||||
| 					sort: '+lastUsedAt' | ||||
|  |  | |||
|  | @ -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, | ||||
| 			}, | ||||
| 		} | ||||
|  |  | |||
|  | @ -66,7 +66,7 @@ export default defineComponent({ | |||
| 				bg: 'var(--bg)', | ||||
| 			}, | ||||
| 			pagination: { | ||||
| 				endpoint: 'i/signin-history', | ||||
| 				endpoint: 'i/signin-history' as const, | ||||
| 				limit: 5, | ||||
| 			}, | ||||
| 		} | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ export default defineComponent({ | |||
| 	data() { | ||||
| 		return { | ||||
| 			pagination: { | ||||
| 				endpoint: 'notes/mentions', | ||||
| 				endpoint: 'notes/mentions' as const, | ||||
| 				limit: 10, | ||||
| 				params: computed(() => ({ | ||||
| 					visibility: 'specified' | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ export default defineComponent({ | |||
| 	data() { | ||||
| 		return { | ||||
| 			pagination: { | ||||
| 				endpoint: 'notes/mentions', | ||||
| 				endpoint: 'notes/mentions' as const, | ||||
| 				limit: 10, | ||||
| 			}, | ||||
| 		} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue