bug fixed
This commit is contained in:
parent
ea2e952586
commit
644a3322df
@ -96,6 +96,19 @@ const QuarterlyWindows = () => {
|
||||
key: null,
|
||||
direction: 'asc'
|
||||
});
|
||||
const extractText = (node) => {
|
||||
if (typeof node === "string") return node;
|
||||
if (typeof node === "number") return String(node);
|
||||
|
||||
if (node?.props?.children) {
|
||||
if (Array.isArray(node.props.children)) {
|
||||
return node.props.children.map(extractText).join(" ");
|
||||
}
|
||||
return extractText(node.props.children);
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
// Format date to yyyy-MM-dd for input fields
|
||||
const formatDateForInput = (dateString) => {
|
||||
@ -709,10 +722,14 @@ const handleSave = async () => {
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (!filteredRows.length) return;
|
||||
// const csvHeader = headers
|
||||
// .filter((h) => h.name !== 'Actions')
|
||||
// .map((h) => `"${h.name}"`)
|
||||
// .join(',');
|
||||
const csvHeader = headers
|
||||
.filter((h) => h.name !== 'Actions')
|
||||
.map((h) => `"${h.name}"`)
|
||||
.join(',');
|
||||
.filter((h) => extractText(h.name) !== 'Actions') // remove Actions
|
||||
.map((h) => `"${extractText(h.name)}"` ) // extract plain text
|
||||
.join(',');
|
||||
const csvRows = filteredRows.map((item) => {
|
||||
const rowData = [
|
||||
item.survey_name || '',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user