ui, ui button component fix

This commit is contained in:
Timur Ercan
2023-02-09 19:58:24 +01:00
parent 88baee6fc2
commit df047bc749
2 changed files with 15 additions and 18 deletions

View File

@ -2,22 +2,18 @@ import toast from "react-hot-toast";
export const updateUser = async (user: any) => {
if (!user) return;
toast
.promise(
fetch("/api/users", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(user),
}),
{
loading: "Saving Changes...",
success: `Saved!`,
error: "Changes could not save user :/",
}
)
.then(() => {
// location.reload();
});
toast.promise(
fetch("/api/users", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(user),
}),
{
loading: "Saving Changes...",
success: `Saved!`,
error: "Changes could not save user :/",
}
);
};

View File

@ -35,6 +35,7 @@ export function Button(props: any) {
) : (
<button
id={props.id}
type="button"
className={classNames(
baseStyles,
color === "primary" ? primaryStyles : secondaryStyles,