refactor(nuxt3): don't include null errors in payload (#2153)

This commit is contained in:
Daniel Roe 2021-11-29 11:22:38 +00:00 committed by GitHub
parent c347b6cc8a
commit 00e6043601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -104,7 +104,9 @@ export function useAsyncData<
.finally(() => {
asyncData.pending.value = false
nuxt.payload.data[key] = asyncData.data.value
nuxt.payload._errors[key] = !!asyncData.error.value
if (asyncData.error.value) {
nuxt.payload._errors[key] = true
}
delete nuxt._asyncDataPromises[key]
})
return nuxt._asyncDataPromises[key]