mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix(webapp): use all drawers name from common enum object
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
} from '@/components';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
* Vendor credit detail actions bar.
|
||||
@@ -39,14 +40,13 @@ function VendorCreditDetailActionsBar({
|
||||
// #withDrawerActions
|
||||
closeDrawer,
|
||||
}) {
|
||||
const { vendorCreditId, vendorCredit } = useVendorCreditDetailDrawerContext();
|
||||
|
||||
const history = useHistory();
|
||||
const { vendorCreditId, vendorCredit } = useVendorCreditDetailDrawerContext();
|
||||
|
||||
// Handle edit credit note.
|
||||
const handleEditVendorCredit = () => {
|
||||
history.push(`/vendor-credits/${vendorCreditId}/edit`);
|
||||
closeDrawer('vendor-credit-detail-drawer');
|
||||
closeDrawer(DRAWERS.VENDOR_CREDIT_DETAILS);
|
||||
};
|
||||
|
||||
// Handle delete credit note.
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import { DrawerHeaderContent, DrawerLoading } from '@/components';
|
||||
import { useFeatureCan } from '@/hooks/state';
|
||||
import { Features } from '@/constants';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
const VendorCreditDetailDrawerContext = React.createContext();
|
||||
|
||||
@@ -61,7 +62,7 @@ function VendorCreditDetailDrawerProvider({ vendorCreditId, ...props }) {
|
||||
}
|
||||
>
|
||||
<DrawerHeaderContent
|
||||
name="vendor-credit-detail-drawer"
|
||||
name={DRAWERS.VENDOR_CREDIT_DETAILS}
|
||||
title={intl.get('vendor_credit.drawer_vendor_credit_detail', {
|
||||
vendorNumber: vendorCredit.vendor_credit_number,
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user