mirror of https://github.com/Hax-io/libpb
- Fixed the use of `serializeRecord` and `fromJSON` in README.md serialization/deserialization examples
This commit is contained in:
parent
78100faaef
commit
cda2e6e54f
|
@ -42,7 +42,7 @@ p1.list = ["1", "2", "3"];
|
|||
p1.extraJSON = parseJSON(`{"item":1, "items":[1,2,3]}`);
|
||||
p1.eType = EnumType.CAT;
|
||||
|
||||
JSONValue serialized = PocketBase.serializeRecord(p1);
|
||||
JSONValue serialized = serializeRecord(p1);
|
||||
|
||||
string[] keys = serialized.object().keys();
|
||||
assert(canFind(keys, "firstname") && cmp(serialized["firstname"].str(), "Tristan") == 0);
|
||||
|
@ -81,7 +81,7 @@ JSONValue json = parseJSON(`{
|
|||
}
|
||||
`);
|
||||
|
||||
Person person = PocketBase.fromJSON!(Person)(json);
|
||||
Person person = fromJSON!(Person)(json);
|
||||
|
||||
debug(dbg)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue