Skip to content

Posting file pointers to REST API #660

Closed
@brandly

Description

@brandly

Hey. We're transitioning onto parse-server. We had old code POSTing images to the REST API, immediately followed by POSTing data to another collection, with a pointer to that earlier image file.

When we were fully on Parse, before using parse-server, we supplied data like this:

'imageObject': {
  'name': data.name,
  '__type': "File"
}

where only a name and a __type were necessary to define that relationship.

Once we moved to parse-server, this code was breaking. It boiled down to this line which also looks for a url. We needed to change out the data we're POSTing to something like this:

'imageObject': {
  'name': data.name,
  'url': data.url,
  '__type': "File"
}

Maybe this information could be provided in migration docs, since we didn't see it there.

It might also be worth mentioning that we're now using the S3Adapter to store our newly-created files in a bucket.

Thanks for everything! Overall, this migration is going far smoother than we could've expected.

cc @kyleseaman

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions