This commit is contained in:
Kevin Grüneberg committed 2026-01-20 17:56:24 +08:00
1 parent 95f901864e
commit 556db8acce
2 files changed
+2 -5

No files matched your search

@@ -178,7 +178,7 @@ export const CreditCodeRedemption = ({ slug }: { slug: string | undefined }) =>
name="code"
render={({ field }) => (
<FormItemLayout label="Code" className="gap-1">
<Input_Shadcn_ {...field} placeholder="100" />
<Input_Shadcn_ {...field} className="uppercase" />
</FormItemLayout>
)}
/>
@@ -1,5 +1,4 @@
import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
import type { ResponseError, UseCustomMutationOptions } from 'types'
@@ -64,9 +63,7 @@ export const useOrganizationCreditCodeRedemptionMutation = ({
await onSuccess?.(data, variables, context)
},
async onError(data, variables, context) {
if (onError === undefined) {
toast.error(`Failed to redeem code: ${data.message}`)
} else {
if (onError !== undefined) {
onError(data, variables, context)
}
},