Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
chore: handle res not ok (#953)
Ameer Al Ashhab12a6e25e9652
diff --git a/apps/web/app/(org)/dashboard/settings/account/Settings.tsx b/apps/web/app/(org)/dashboard/settings/account/Settings.tsxindex 0aff8d02c..e97793dfe 100644--- a/apps/web/app/(org)/dashboard/settings/account/Settings.tsx+++ b/apps/web/app/(org)/dashboard/settings/account/Settings.tsx@@ -18,13 +18,17 @@ export const Settings = ({const { mutate: updateName, isPending: updateNamePending } = useMutation({mutationFn: async () => {- await fetch("/api/settings/user/name", {+ const res = await fetch("/api/settings/user/name", {method: "POST",- headers: {- "Content-Type": "application/json",- },- body: JSON.stringify({ firstName, lastName }),+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({+ firstName: firstName.trim(),+ lastName: lastName.trim() ? lastName.trim() : null,+ }),});+ if (!res.ok) {+ throw new Error("Failed to update name");+ }},onSuccess: () => {toast.success("Name updated successfully");