ListFields return all customized fields @Summary return all customized fields @Description return all customized fieldsh @Tags plugins/customize @Param table path string true "the table name" @Success 200 {object} []fieldResponse "Success" @Failure 400 {object} shared.ApiBody "Bad Request" @Failur
(input *plugin.ApiResourceInput)
| 92 | // @Failure 500 {object} shared.ApiBody "Internal Error" |
| 93 | // @Router /plugins/customize/{table}/fields [GET] |
| 94 | func (h *Handlers) ListFields(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 95 | customizedFields, err := h.svc.GetFields(input.Params["table"]) |
| 96 | if err != nil { |
| 97 | return &plugin.ApiResourceOutput{Status: http.StatusBadRequest}, errors.Default.Wrap(err, "getFields error") |
| 98 | } |
| 99 | fields := make([]fieldResponse, 0, len(customizedFields)) |
| 100 | for _, cf := range customizedFields { |
| 101 | fields = append(fields, fromCustomizedField(cf)) |
| 102 | } |
| 103 | return &plugin.ApiResourceOutput{Body: fields, Status: http.StatusOK}, nil |
| 104 | } |
| 105 | |
| 106 | // CreateFields create a customized field |
| 107 | // @Summary create a customized field |
nothing calls this directly
no test coverage detected