Browse Source

fix: catch block

pull/9323/head
DarkPhoenix2704 2 months ago
parent
commit
bc409ab200
  1. 8
      packages/nc-gui/composables/useProductFeed.ts

8
packages/nc-gui/composables/useProductFeed.ts

@ -2,8 +2,7 @@ import axios from 'axios'
import type { ProductFeedItem } from '../lib/types'
const axiosInstance = axios.create({
// baseURL: 'https://nocodb.com/api',
baseURL: 'http://localhost:8000/api/v1',
baseURL: 'https://nocodb.com/api/v1',
headers: {
'Content-Type': 'application/json',
},
@ -19,6 +18,7 @@ export const useProductFeed = createSharedComposable(() => {
const socialFeed = ref<ProductFeedItem[]>([])
const loadFeed = async ({ loadMore, type }: { loadMore: boolean; type: 'youtube' | 'github' | 'all' | 'twitter' }) => {
try {
let page = 1
if (loadMore) {
@ -44,6 +44,10 @@ export const useProductFeed = createSharedComposable(() => {
})
return response.data
} catch (error) {
console.error(error)
return []
}
}
return {

Loading…
Cancel
Save