brilliant-orangeB
Refine2y ago
3 replies
brilliant-orange

Why input request type string?

export const PointsModal = ({ type, point_id, member_id }: PointsModalProps) => {
  const {
    register,
    setValue,
    formState: { errors },
    handleSubmit,
    reset,
    refineCore: { onFinish },
  } = useForm<IPointDetail, HttpError, Nullable<IPointDetail>>({
    refineCoreProps: {
      resource: 'points',
      action: 'create',
      redirect: 'list',
    },
  })

...

<FormControl>
  <FormLabel>{isPay ? '추가 지급할 적립금' : '회수할 적립금'}</FormLabel>
  <OutlinedInput
    type="number"
    id="amount"
    error={!!errors.amount}
    {...register('amount', {
      required: t('errors.required.field', {
        field: 'amount',
      }),
    })}
    style={{ height: '40px' }}
  />
</FormControl>


I use OutlinedInput, receive it as a number and submit. At this time, the amount is delivered as a string, not a number.
Was this page helpful?