refactor
This commit is contained in:
@@ -137,7 +137,7 @@ export const useManagementModals = ({
|
||||
|
||||
const handleCorrespondentCreateSafe = useCallback<CorrespondentsPanelProps['onCreate']>(
|
||||
async (payload) => {
|
||||
if (typeof onCorrespondentCreate !== 'function') {
|
||||
if (!onCorrespondentCreate) {
|
||||
return undefined;
|
||||
}
|
||||
return onCorrespondentCreate(payload) ?? undefined;
|
||||
@@ -147,7 +147,7 @@ export const useManagementModals = ({
|
||||
|
||||
const handleCorrespondentUpdateSafe = useCallback<CorrespondentsPanelProps['onUpdate']>(
|
||||
async (id, payload) => {
|
||||
if (typeof onCorrespondentUpdate !== 'function') {
|
||||
if (!onCorrespondentUpdate) {
|
||||
return;
|
||||
}
|
||||
await onCorrespondentUpdate(id, payload);
|
||||
@@ -157,7 +157,7 @@ export const useManagementModals = ({
|
||||
|
||||
const handleCorrespondentDeleteSafe = useCallback<CorrespondentsPanelProps['onDelete']>(
|
||||
async (id) => {
|
||||
if (typeof onCorrespondentDelete !== 'function') {
|
||||
if (!onCorrespondentDelete) {
|
||||
return;
|
||||
}
|
||||
await onCorrespondentDelete(id);
|
||||
|
||||
Reference in New Issue
Block a user