🐛 fix(coupon): Rename 'server' field to 'subscribe' in coupon form and update coupon update request type

This commit is contained in:
web@ppanel 2025-01-09 20:25:34 +07:00
parent b01a5bc83b
commit f8b6d82780
3 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,7 @@ export default function CouponForm<T extends Record<string, any>>({
)}
<FormField
control={form.control}
name='server'
name='subscribe'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.specifiedServer')}</FormLabel>

View File

@ -96,9 +96,9 @@ export default function Page() {
defaultChecked={row.getValue('enable')}
onCheckedChange={async (checked) => {
await updateCoupon({
...row,
...row.original,
enable: checked,
} as any);
} as API.UpdateCouponRequest);
ref.current?.refresh();
}}
/>

View File

@ -100,7 +100,7 @@ export function Combobox<T, M extends boolean = false>({
{options.map((option) => (
<CommandItem
key={String(option.label + option.value)}
value={option.label}
value={option.label + option.value}
onSelect={() => handleSelect(option.value)}
>
{option.children || option.label}