Skip to content

Commit

Permalink
Replace person.import with new bulk ops in prepareImportOperations()
Browse files Browse the repository at this point in the history
  • Loading branch information
richardolsson committed Jan 16, 2025
1 parent 264cbca commit 8d76168
Show file tree
Hide file tree
Showing 4 changed files with 661 additions and 1,292 deletions.
35 changes: 35 additions & 0 deletions src/features/import/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { ZetkinPerson } from 'utils/types/zetkin';

type PersonSetfieldsBulkOp = {
data: Partial<ZetkinPerson>;
op: 'person.setfields';
};

type PersonTagBulkOp = {
op: 'person.tag';
tag_id: number;
value?: string | number | null;
};

type PersonAddtoorgBulkOp = {
op: 'person.addtoorg';
org_id: number;
};

type PersonCreateBulkOp = {
op: 'person.create';
ops: BulkSubOp[];
};

type PersonGetBulkOp = {
key: { id: number } | { ext_id: string };
op: 'person.get';
ops: BulkSubOp[];
};

export type BulkSubOp =
| PersonSetfieldsBulkOp
| PersonTagBulkOp
| PersonAddtoorgBulkOp;

export type BulkOp = PersonCreateBulkOp | PersonGetBulkOp;
Loading

0 comments on commit 8d76168

Please sign in to comment.