I’m frequently writing CRUD routes that duplicate a lot of code between the new and edit route. For example, if I’m rendering a “Project” select field in a form I typically want to load all projects in afterModel. In many cases, the only differences between the two routes are whether I create a new record or find an existing record.
Any recommendations on how to reduce this duplication?