edisonywh / backoffice

Admin tool built with the PETAL stack
MIT License
217 stars 15 forks source link

Massive change of API #30

Closed edisonywh closed 3 years ago

edisonywh commented 3 years ago
edisonywh commented 3 years ago

I'm not sure if this is the best way since users now need to duplicate implementation for Index and Single.

Maybe one way to help is allow users to "tie" a "Single" module to a Index? For example something like this:

defmodule YourApp.Resource.Single do
  use Backoffice.Resource.Single,
    parent: YourApp.Resource.Index
end

This way it communicates the relationship between Single & Index, and also mean that user don't need to redefine all the resource opts. Not sure where to go from here.