Fixed federation structure sync, added a response wrapper to api response
This commit is contained in:
@@ -8,20 +8,26 @@ import (
|
||||
|
||||
type (
|
||||
EncoderAdapterCortezaInternal struct{}
|
||||
|
||||
ResponseWrapper struct {
|
||||
Response interface{} `json:"response"`
|
||||
}
|
||||
)
|
||||
|
||||
// Build a default Corteza response
|
||||
func (a EncoderAdapterCortezaInternal) BuildStructure(w io.Writer, o options.FederationOpt, p interface{}) (interface{}, error) {
|
||||
return listModuleResponseCortezaInternal{
|
||||
Filter: p.(ListStructurePayload).Filter,
|
||||
Set: p.(ListStructurePayload).Set,
|
||||
}, nil
|
||||
return ResponseWrapper{
|
||||
Response: listModuleResponseCortezaInternal{
|
||||
Filter: p.(ListStructurePayload).Filter,
|
||||
Set: p.(ListStructurePayload).Set,
|
||||
}}, nil
|
||||
}
|
||||
|
||||
// Build a default Corteza response
|
||||
func (a EncoderAdapterCortezaInternal) BuildData(w io.Writer, o options.FederationOpt, p interface{}) (interface{}, error) {
|
||||
return listRecordResponseCortezaInternal{
|
||||
Filter: p.(ListDataPayload).Filter,
|
||||
Set: p.(ListDataPayload).Set,
|
||||
}, nil
|
||||
return ResponseWrapper{
|
||||
Response: listRecordResponseCortezaInternal{
|
||||
Filter: p.(ListDataPayload).Filter,
|
||||
Set: p.(ListDataPayload).Set,
|
||||
}}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user