Catalog updated
This commit is contained in:
@@ -57,6 +57,8 @@ func (o *ResourceController) notFound() {
|
||||
// @Description list all resources across all types
|
||||
// @Param type path string true "the type you want to get"
|
||||
// @Param is_draft query string false "draft wished"
|
||||
// @Param offset query string false "offset wished"
|
||||
// @Param limit query string false "limit wished"
|
||||
// @Success 200 {resource} models.resource
|
||||
// @router /:type [get]
|
||||
func (o *ResourceController) GetAll() {
|
||||
@@ -86,6 +88,8 @@ func (o *ResourceController) GetAll() {
|
||||
// @Param type path string true "the type you want to get"
|
||||
// @Param search path string true "the search you want to get"
|
||||
// @Param is_draft query string false "draft wished"
|
||||
// @Param offset query string false "offset wished"
|
||||
// @Param limit query string false "limit wished"
|
||||
// @Success 200 {resource} models.resource
|
||||
// @router /:type/search/:search [get]
|
||||
func (o *ResourceController) Search() {
|
||||
@@ -151,8 +155,9 @@ func (o *ResourceController) Post() {
|
||||
}
|
||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
var res map[string]interface{}
|
||||
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
|
||||
json.Unmarshal(o.Ctx.Input.CopyBody(100000), &res)
|
||||
data := oclib.NewRequest(libs[0], user, peerID, groups, nil).StoreOne(res)
|
||||
fmt.Println(data.Data, res["name"], libs[0])
|
||||
if data.Err == "" {
|
||||
payload, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
infrastructure.EmitNATS(user, groups, tools.PropalgationMessage{
|
||||
@@ -206,10 +211,12 @@ func (o *ResourceController) Put() {
|
||||
// @Success 200 {resource} models.resource
|
||||
// @router /:type/:id [delete]
|
||||
func (o *ResourceController) Delete() {
|
||||
fmt.Println("THERE")
|
||||
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
|
||||
id := o.Ctx.Input.Param(":id")
|
||||
for _, col := range o.collection(false) {
|
||||
data := oclib.NewRequest(col, user, peerID, groups, nil).DeleteOne(id)
|
||||
fmt.Println(col, data, id)
|
||||
if data.Err == "" {
|
||||
o.Data["json"] = data
|
||||
payload, _ := json.Marshal(data.Data.Serialize(data.Data))
|
||||
|
||||
Reference in New Issue
Block a user