Progress on data source admin
This commit is contained in:
1 parent
b70a3f0958
commit
27f07e9de2
10 files changed
+106
-72
No files matched your search
@@ -8,10 +8,26 @@ import (
|
||||
|
||||
func GetDataSources(c *middleware.Context) {
|
||||
query := m.GetDataSourcesQuery{AccountId: c.Account.Id}
|
||||
err := bus.SendQuery(&query)
|
||||
err := bus.Dispatch(&query)
|
||||
|
||||
if err != nil {
|
||||
c.JsonApiErr(500, "Failed to query datasources", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func AddDataSource(c *middleware.Context) {
|
||||
cmd := m.AddDataSourceCommand{}
|
||||
|
||||
if !c.JsonBody(&cmd) {
|
||||
c.JsonApiErr(400, "bad request", nil)
|
||||
return
|
||||
}
|
||||
|
||||
err := bus.Dispatch(&cmd)
|
||||
if err != nil {
|
||||
c.JsonApiErr(500, "Failed to add datasource", err)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user