Skip to content

Commit

Permalink
[pocketbase#2205] fixed Record.WithUnknownData() typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Apr 3, 2023
1 parent 8ca439e commit 9f76ad2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## (WIP)

- Fixed typo in `Record.WithUnkownData()` -> `Record.WithUnknownData()`.


## v0.14.2

- Reverted part of the old `COALESCE` handling to continue supporting empty string comparison with missing joined relation fields.
- Reverted part of the old `COALESCE` handling as a fallback to support empty string comparison with missing joined relation fields.


## v0.14.1
Expand Down Expand Up @@ -1150,7 +1155,7 @@ Please check the individual SDK package changelog and apply the necessary change
- Added option to return serialized custom `models.Record` fields data:
```go
func (m *Record) UnknownData() map[string]any
func (m *Record) WithUnkownData(state bool)
func (m *Record) WithUnknownData(state bool)
```

- Deleted `model.User`. Now the user data is stored as an auth `models.Record`.
Expand Down
4 changes: 2 additions & 2 deletions models/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ func (m *Record) IgnoreEmailVisibility(state bool) {
m.ignoreEmailVisibility = state
}

// WithUnkownData toggles the export/serialization of unknown data fields
// WithUnknownData toggles the export/serialization of unknown data fields
// (false by default).
func (m *Record) WithUnkownData(state bool) {
func (m *Record) WithUnknownData(state bool) {
m.exportUnknown = state
}

Expand Down
4 changes: 2 additions & 2 deletions models/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func TestRecordCleanCopy(t *testing.T) {
// allow the special flags and options to check whether they will be ignored
m.SetExpand(map[string]any{"test": 123})
m.IgnoreEmailVisibility(true)
m.WithUnkownData(true)
m.WithUnknownData(true)

copy := m.CleanCopy()
copyExport, _ := copy.MarshalJSON()
Expand Down Expand Up @@ -1343,7 +1343,7 @@ func TestRecordPublicExportAndMarshalJSON(t *testing.T) {

m.Load(data)
m.IgnoreEmailVisibility(s.exportHidden)
m.WithUnkownData(s.exportUnknown)
m.WithUnknownData(s.exportUnknown)

exportResult, err := json.Marshal(m.PublicExport())
if err != nil {
Expand Down

0 comments on commit 9f76ad2

Please sign in to comment.