Closed CRC32EX closed 1 week ago
Change the Argument Type: Update the argument type of the errorNotification function to match the actual type (Response). Support Async/Await: Modify the function to support async/await syntax. For example, if the function is defined in a TypeScript file, it might look like this:
import { OpenNotificationParams } from 'path/to/type/definition';
async function errorNotification(response: Response): Promise
const obj = await response.json() as MyErrorType;
return {
type: "error",
message: obj.message,
description: obj.description,
};
}
Excuse me, I just wanted to make suggestions. I'll be more thorough if I can get to this later, thanks.
Could you be more clear with what do you mean? This might return response or anything else, it depends on the situtation. But what Refine needs is this error structure. These fields will be used to render error notification. It may have more fields than that, but they are redundant.
Describe the bug
errorNotification
's 1st argument iserror
. But, The real type isResponse
, Please fix it.And, please support async / await. I want write code, like this.
Steps To Reproduce
Expected behavior
Packages
Next.js
Additional Context
No response