I want to import a csv with entries that are not in the table but reference to another table. I am able to import the rows for the main table with ImportConfig
-> transformedRows
from the react-admin-import-csv
package. But how to write the many to many references to their according tables? Maybe with postCommitCallback
from the package? I need help! Any Ideas? Thx
I tried to play around with postCommitCallback
, but no success so far.
import { DataProvider } from 'react-admin';
import { TableReferenceCSVRow, } from '@/types/csv';
export const postCommitCallback = (rows: TableReferenceCSVRow[], dataProvider: DataProvider) => {
???
}
I have the following interfaces
export interface TableReferenceCSVRow {
id: number;
main_id: number;
reference_id: number;
zusatz: string;
}
export interface ReferenceCSVRow {
id: number;
reference: string;
exampletext: string;
}
kvo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.