Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Problem with Create, Update and Delete Operations #89

Open
bunyaminsg opened this issue Feb 6, 2017 · 1 comment
Open

Problem with Create, Update and Delete Operations #89

bunyaminsg opened this issue Feb 6, 2017 · 1 comment

Comments

@bunyaminsg
Copy link

There is a header appended to these methods

var ReturnHeader = $$Header('Prefer', 'return=representation');
"delete": DELETE.and(resourcePath).and(ReturnHeader).end(http),
create: POST.and(resourceTypePath).and(ReturnHeader).end(http),
update: PUT.and(resourcePath).and(ReturnHeader).end(http),

And it gives Request header field prefer is not allowed by Access-Control-Allow-Headers in preflight response. error. When I delete this header, it works.

Also for the create operation, the example on your README file is:

var entry = {
  category: [{term: 'TAG term', schema: 'TAG schema', label: 'TAG label'}, ...]
  content: {
    resourceType: 'Patient',
    //...
  }
}

But it doesn't work when the resource is in the content field. It gives error and expects resource.resourceType field, so I changed the content to resource and it worked. Please update your readme file or make a better documentation for all the operations.

@divyaverma26
Copy link

@bunyaminsg Create is not working for me What did you put in category? Do yo have some documentation or may be sample for create resource in js?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants