Skip to content

Commit ee568a1

Browse files
committed
♻️ Minor tweaks
1 parent c8532dc commit ee568a1

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

frontend/src/components/Admin/AddUser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const AddUser = () => {
7575
mutationFn: (data: UserCreate) =>
7676
UsersService.createUser({ requestBody: data }),
7777
onSuccess: () => {
78-
showSuccessToast("User created successfully.")
78+
showSuccessToast("User created successfully")
7979
form.reset()
8080
setIsOpen(false)
8181
},

frontend/src/components/Admin/EditUser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const EditUser = ({ user, onSuccess }: EditUserProps) => {
7777
mutationFn: (data: FormData) =>
7878
UsersService.updateUser({ userId: user.id, requestBody: data }),
7979
onSuccess: () => {
80-
showSuccessToast("User updated successfully.")
80+
showSuccessToast("User updated successfully")
8181
setIsOpen(false)
8282
onSuccess()
8383
},

frontend/src/components/Items/AddItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import useCustomToast from "@/hooks/useCustomToast"
3131
import { handleError } from "@/utils"
3232

3333
const formSchema = z.object({
34-
title: z.string().min(1, { message: "Title is required." }),
34+
title: z.string().min(1, { message: "Title is required" }),
3535
description: z.string().optional(),
3636
})
3737

@@ -56,7 +56,7 @@ const AddItem = () => {
5656
mutationFn: (data: ItemCreate) =>
5757
ItemsService.createItem({ requestBody: data }),
5858
onSuccess: () => {
59-
showSuccessToast("Item created successfully.")
59+
showSuccessToast("Item created successfully")
6060
form.reset()
6161
setIsOpen(false)
6262
},

frontend/src/components/Items/EditItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import useCustomToast from "@/hooks/useCustomToast"
3131
import { handleError } from "@/utils"
3232

3333
const formSchema = z.object({
34-
title: z.string().min(1, { message: "Title is required." }),
34+
title: z.string().min(1, { message: "Title is required" }),
3535
description: z.string().optional(),
3636
})
3737

@@ -61,7 +61,7 @@ const EditItem = ({ item, onSuccess }: EditItemProps) => {
6161
mutationFn: (data: FormData) =>
6262
ItemsService.updateItem({ id: item.id, requestBody: data }),
6363
onSuccess: () => {
64-
showSuccessToast("Item updated successfully.")
64+
showSuccessToast("Item updated successfully")
6565
setIsOpen(false)
6666
onSuccess()
6767
},

frontend/src/components/UserSettings/UserInformation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const UserInformation = () => {
5252
mutationFn: (data: UserUpdateMe) =>
5353
UsersService.updateUserMe({ requestBody: data }),
5454
onSuccess: () => {
55-
showSuccessToast("User updated successfully.")
55+
showSuccessToast("User updated successfully")
5656
toggleEditMode()
5757
},
5858
onError: handleError.bind(showErrorToast),

frontend/src/routes/login.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ function Login() {
5555
},
5656
})
5757

58-
const onSubmit = async (data: FormData) => {
58+
const onSubmit = (data: FormData) => {
5959
if (loginMutation.isPending) return
60-
await loginMutation.mutateAsync(data)
60+
loginMutation.mutate(data)
6161
}
6262

63+
6364
return (
6465
<AuthLayout>
6566
<Form {...form}>

frontend/src/routes/recover-password.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function RecoverPassword() {
5959
const mutation = useMutation({
6060
mutationFn: recoverPassword,
6161
onSuccess: () => {
62-
showSuccessToast("Password recovery email sent successfully.")
62+
showSuccessToast("Password recovery email sent successfully")
6363
form.reset()
6464
},
6565
onError: handleError.bind(showErrorToast),

0 commit comments

Comments
 (0)