Skip to content

SignUp encoding data to JSON #466

Closed
Closed
@kwizner

Description

@kwizner

Future<ParseResponse> signUp() async {

Hi,

I was trying add some data while registering user, but it doesn't work with DateTime object because DateTime does't has toJson method. And we have to send different format to parse than just DateTime in String.

I paste my solution below to save password to unsavedChanges and use existing method toJson from your library.
Instead of current code

      final Map<String, dynamic> bodyData = _getObjectData();
      bodyData[keyVarPassword] = password;
      ...
      final String body = json.encode(bodyData);

I use this

      _unsavedChanges[keyVarPassword] = password;
      ...
      final String body = json.encode(toJson(forApiRQ: true));

With this body we can create parse user with all data.

Let me know if it's clear. If not I will come back with more info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions