fix: resolve build type errors in gallery pagination
Remove unused nextTick import, fix generic type assertion on supabase.from select options, and add double type cast for query result mapping.
This commit is contained in:
1 parent
02d64bf206
commit
6bce7276e2
1 file changed
+3
-3
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||
import { NAlert, NButton, NDropdown, NEmpty, NIcon, NSkeleton, NTag, useMessage } from 'naive-ui'
|
||||
import { Clock, Location, Search, Settings, User, X } from '@vicons/tabler'
|
||||
import CloudEditModal, { type CloudEditFormValue } from '@/components/cloud/CloudEditModal.vue'
|
||||
@@ -166,7 +166,7 @@ const FULL_SELECT = 'id,user_id,cloud_type_id,image_url,thumbnail_url,location_n
|
||||
function buildFilteredQuery(selectStr: string, options?: { count?: 'exact'; head?: boolean }) {
|
||||
let query = supabase
|
||||
.from('clouds')
|
||||
.select(selectStr, options as Parameters<typeof supabase.from<'clouds'>['select']>[1])
|
||||
.select(selectStr, options as any)
|
||||
.eq('status', 'approved')
|
||||
.eq('is_hidden', false)
|
||||
|
||||
@@ -215,7 +215,7 @@ async function loadPage(page: number) {
|
||||
if (error) throw error
|
||||
|
||||
totalCount.value = count ?? 0
|
||||
galleryItems.value = ((data || []) as Array<Record<string, unknown>>).map(toGalleryCloud)
|
||||
galleryItems.value = ((data || []) as unknown as Array<Record<string, unknown>>).map(toGalleryCloud)
|
||||
currentPage.value = page
|
||||
} catch (error) {
|
||||
loadError.value = error instanceof Error ? error.message : '画廊加载失败'
|
||||
|
||||
Reference in new issue
Block a user