preCommitCallback is incorrectly called with a first argument of `create` for an update
bayareacoder opened this issue · comments
B commented
In file uploader.ts
, the preCommitCallback is incorrectly called with a first argument of create
for an update, while it should be overwrite
per the type definition
file uploader.ts
:
export async function update(
logging: boolean,
dataProvider: DataProvider,
resource: string,
values: any[],
preCommitCallback: PrecommitCallback,
postCommitCallback: ErrorCallback,
) {
const parsedValues = preCommitCallback ? await preCommitCallback('create', values) : values;
file config.interface.ts
:
export type PrecommitCallback = (action: 'create' | 'overwrite', values: any[]) => Promise<any[]>;
Ben Winding commented
Thanks again @bayareacoder,
Feel free to submit a Pull Request for future issues if you'd like!
Cheers,
Ben