dynamic-modal
Version:
The dynamic-modal is a solution of creation different modals into project using a json configuration file
21 lines (20 loc) • 675 B
JavaScript
;
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.liveDataHandler = exports.liveDataAction = void 0;
const liveDataAction = async (fieldData, formData, action) => {
if (typeof fieldData === 'string') {
const options = await action(fieldData, formData);
return options ?? [];
}
return [];
};
exports.liveDataAction = liveDataAction;
const liveDataHandler = async (fieldData, formData, action) => {
if (typeof fieldData === 'string') {
const result = await action(fieldData, formData);
return result ?? false;
}
return false;
};
exports.liveDataHandler = liveDataHandler;