Skip to content

Commit

Permalink
chore: add debug log if data exists in error response
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Oct 1, 2024
1 parent d380c80 commit 258de9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const $api = ofetch.create({
if (ctx.response._data?.message) {
ctx.error = new Error(`- ${ctx.response._data.message}`)
}
if (ctx.response._data?.data) {
consola.debug(ctx.response._data?.data)
}
}
})

Expand Down

0 comments on commit 258de9e

Please sign in to comment.