1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) payment schedule by check

This commit is contained in:
Sylvain 2023-01-05 11:45:23 +01:00
parent b6146bad18
commit ac187a986f
2 changed files with 6 additions and 1 deletions

View File

@ -34,6 +34,7 @@
- Fix a bug: unable to update title of availability after admin remove a machine/plan in calendar
- Fix a bug: unable to access files from the public folder (like example.csv)
- Fix a bug: unable to return to the statistics tab
- Fix a bug: payment schedule by check result in error if payment mean was not changed
- Updated react-modal to 3.16.1
- Updated tiptap editor and its dependencies to 2.0.0-beta.204
- [TODO DEPLOY] `rails db:seed`

View File

@ -1,5 +1,5 @@
import { FormEvent, useEffect, useState } from 'react';
import * as React from 'react';
import { FormEvent, useEffect, useState } from 'react';
import Select from 'react-select';
import { useTranslation } from 'react-i18next';
import { GatewayFormProps } from '../abstract-payment-modal';
@ -11,6 +11,7 @@ import { PaymentSchedule } from '../../../models/payment-schedule';
import { HtmlTranslate } from '../../base/html-translate';
import CheckoutAPI from '../../../api/checkout';
import { SelectOption } from '../../../models/select';
import { PaymentMethod } from '../../../models/payment';
const ALL_SCHEDULE_METHODS = ['card', 'check', 'transfer'] as const;
type scheduleMethod = typeof ALL_SCHEDULE_METHODS[number];
@ -28,6 +29,9 @@ export const LocalPaymentForm: React.FC<GatewayFormProps> = ({ onSubmit, onSucce
useEffect(() => {
setMethod(cart.payment_method || 'check');
if (cart.payment_method === '') {
cart.payment_method = PaymentMethod.Check;
}
}, [cart]);
/**