mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
toast fix
This commit is contained in:
@ -29,7 +29,8 @@ export default function Signup() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const signUp: SubmitHandler<FormValues> = async (data) => {
|
const signUp: SubmitHandler<FormValues> = async (data) => {
|
||||||
const res = await toast.promise(
|
const res = await toast
|
||||||
|
.promise(
|
||||||
fetch("/api/auth/signup", {
|
fetch("/api/auth/signup", {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
...data,
|
...data,
|
||||||
@ -45,11 +46,6 @@ export default function Signup() {
|
|||||||
...data,
|
...data,
|
||||||
callbackUrl: "https://app.documenso.com/dashboard",
|
callbackUrl: "https://app.documenso.com/dashboard",
|
||||||
});
|
});
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
methods.setError("apiError", { message: err.message });
|
|
||||||
// Throw again for toast
|
|
||||||
throw new Error(err.message);
|
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
loading: "Creating your account...",
|
loading: "Creating your account...",
|
||||||
@ -61,7 +57,11 @@ export default function Signup() {
|
|||||||
minWidth: "200px",
|
minWidth: "200px",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
|
.catch((err) => {
|
||||||
|
toast.dismiss();
|
||||||
|
methods.setError("apiError", { message: err.message });
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function renderApiError() {
|
function renderApiError() {
|
||||||
|
|||||||
Reference in New Issue
Block a user