mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2025-12-30 08:14:25 +00:00
More fixes for _request
This commit is contained in:
@@ -294,7 +294,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
||||
|
||||
logger.Info("Creating records for %s.%s", schema, entity)
|
||||
|
||||
// Check if data contains nested relations or crud_request field
|
||||
// Check if data contains nested relations or _request field
|
||||
switch v := data.(type) {
|
||||
case map[string]interface{}:
|
||||
// Check if we should use nested processing
|
||||
@@ -1003,7 +1003,7 @@ func (h *Handler) RegisterModel(schema, name string, model interface{}) error {
|
||||
}
|
||||
|
||||
// shouldUseNestedProcessor determines if we should use nested CUD processing
|
||||
// It checks if the data contains nested relations or a crud_request field
|
||||
// It checks if the data contains nested relations or a _request field
|
||||
func (h *Handler) shouldUseNestedProcessor(data map[string]interface{}, model interface{}) bool {
|
||||
return common.ShouldUseNestedProcessor(data, model, h)
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@ type GormTableSchemaInterface interface {
|
||||
}
|
||||
|
||||
type GormTableCRUDRequest struct {
|
||||
CRUDRequest *string `json:"crud_request"`
|
||||
Request *string `json:"_request"`
|
||||
}
|
||||
|
||||
func (r *GormTableCRUDRequest) SetRequest(request string) {
|
||||
r.CRUDRequest = &request
|
||||
r.Request = &request
|
||||
}
|
||||
|
||||
func (r GormTableCRUDRequest) GetRequest() string {
|
||||
return *r.CRUDRequest
|
||||
return *r.Request
|
||||
}
|
||||
|
||||
// New interfaces that replace the legacy ones above
|
||||
|
||||
Reference in New Issue
Block a user