diff --git a/composables/useFetchRequest.js b/composables/useFetchRequest.js index 6903e1ad91dae8f0e1fa44b9560e84d03693ef82..7653a6516bd8b84ba75254f2ce05042e8cd391c0 100644 --- a/composables/useFetchRequest.js +++ b/composables/useFetchRequest.js @@ -9,7 +9,13 @@ const useFetchRequest = (baseUrl) => { fetchConfig = fetchConfig || {} fetchConfig.method = (fetchConfig.method || 'get').toLocaleUpperCase() fetchConfig = Object.assign(config, fetchConfig) - return $fetch(url, fetchConfig) + return new Promise((resolve, reject) => { + $fetch(url, fetchConfig).then((result) => { + resolve(result) + }).catch(() => { + resolve(null) + }) + }) } return { fetchRequest