split the `import` method from `NoteCreateService` into its own file, and reduce code duplication between create/edit/import
git merge
gets pretty confused by NoteCreateService
because create
and import
are nearly identical, so often upstream changes get applied to import
instead of create
We can split import
into its own NoteImportService
.
Then, to avoid having to copy all the smaller helper functions, we can have both NoteEditService
and NoteImportService
get an instance of NoteCreateService
and call the helpers on that.
We can't do much to avoid copying the main body of the create
method into import
and edit
, but we could factor out as much as we can between those two, since we control them. OTOH, having the three methods look very similar may help make sure we apply all upstream changes to all three…