- Fixed the use of `serializeRecord` and `fromJSON` in README.md serialization/deserialization examples

This commit is contained in:
Tristan B. Velloza Kildaire 2023-01-02 16:38:08 +02:00
parent 78100faaef
commit cda2e6e54f
1 changed files with 2 additions and 2 deletions

View File

@ -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)
{