moonlight-labs / aor-jsonapi-client Goto Github PK
View Code? Open in Web Editor NEWJSON-API compliant restClient for Admin-On-Rest
JSON-API compliant restClient for Admin-On-Rest
We've run into an issue where this client is requiring a meta
tag that contains a total
value in the JSON response from the server. There is nothing in the JSON API spec that requires this, so the client should be able to gracefully recover when it's not provided OR provided some other way to plug-in code that provides the total record count (in case the server puts that total in a different, non-standard meta field).
I see that #1 was raised about something similar, though that issue is light on detail.
Also see JSON API - Examples:
Note: Putting a property like "total-pages" in "meta" can be a convenient way to indicate to clients the total number of pages in a collection (as opposed to the "last" link, which simply gives the URI of the last page). However, all "meta" values are implementation-specific, so you can call this member whatever you like ("total", "count", etc.) or not use it at all.
I'm having issues with the edit form, which may well be user error, but I could do with some advice. The show method on my API returns something like
{"data":{"type":"post","id":"1","attributes":{"title":"Magic"}}}
The only way I can get an Edit Form to work is by having fields like
<TextInput source="attributes.title" />
However, when I do that, submitted the form doesn't include any updated attributes. Any wisdom?
...
Object.keys(params.data.attributes).forEach(key => attrs[key] = params.data[key]);
should be:
Object.keys(params.data).forEach(key => attrs[key] = params.data[key]);
?
Hi,
Admin-On-Rest was renamed to React Admin with its 2.0 upgrade.
Will you plan to support this version as well ?
Thank you!
I'm newbie of javascript.
Please tell me how detect type in this code.
I understand apiUrl & httpClient is arguments.
export default (apiUrl, httpClient = jsonApiHttpClient) => {
I can't understand this phrase.
return (type, resource, params) => {
Who detect type, resource, params?
I feel that this post is not suitable on this place.Sorry..
Currently GET_ONE returns data.attributes
, but UPDATE and CREATE returns data
. Here https://github.com/moonlight-labs/aor-jsonapi-client/blob/master/src/restClient.js#L124
Is this intentional?
Hi,
I've done some changes on restClient.js
to transform resources and relations.
https://github.com/Zhomart/aor-jsonapi-client/blob/master/CHANGELOG.md
I use it on my own projects, works well. If it looks ok to you, I can create PR.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.