Skip to content

Commit

Permalink
fix: add ability to unmarshall objects (surrealdb#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
AAA1exa8 committed May 25, 2024
1 parent bc55e64 commit f3e5a66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/marshal/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const StatusOK = "OK"
type RawQuery[I any] struct {
Status string `json:"status"`
Time string `json:"time"`
Result []I `json:"result"`
Result I `json:"result"`
Detail string `json:"detail"`
}

Expand Down Expand Up @@ -101,7 +101,7 @@ func SmartUnmarshal[I any](respond interface{}, wrapperError error) (outputs []I
if raw.Status != StatusOK {
err = errors.Join(err, errors.New(raw.Status))
} else {
outputs = append(outputs, raw.Result...)
outputs = append(outputs, raw.Result)
}
}
}
Expand Down

0 comments on commit f3e5a66

Please sign in to comment.