admin
admin copied to clipboard
Singleton resource generates incorrect URL or route for resources actions
the following code generates an invalid route or url:
apicRepo := Admin.AddResource(&models.ApiConnectRepository{}, &admin.Config{Singleton: true, Menu: []string{"API Connect"}})
apicRepo.Action(&admin.Action{
Name: "Update",
Handler: func(actionArgument *admin.ActionArgument) error {
for _, record := range actionArgument.FindSelectedRecords() {
actionArgument.Context.DB.Model(record.(*models.ApiConnectRepository))
}
return nil
},
Permission: roles.Allow(roles.CRUD, roles.Anyone),
Modes: []string{"edit"},
})
every action in a singleton resource returns a 404
Hey did you found any way? I guess this bug isnt patched yet?