Open MehmetKursat opened 7 years ago
Hey @FiatPax ! Try import pledge_schema from 'src/schemas/pledge'
Alright I tried and now I get this error: Cannot read property 'Symbol(Symbol.iterator)' of undefined
Just in case you need to see my code
var patreonAPI = patreon.default
var patreonOAuth = patreon.oauth
test(request, reply) {
var patreonAPIClient = patreonAPI(access_tkn)
const url = jsonApiURL(`/current_user`, {
fields: {
pledge: [...pledge_schema.default_attributes, pledge_schema.attributes.total_historical_amount_cents]
}
})
patreonAPIClient(url, function (err, res) {
reply(res)
})
}
Struggled with trying to inlude the total_historical_amount_cents field in the json return. Found the schemas in the 'dist' folder of the npm install:
import pledge_schema from 'patreon/dist/schemas/pledge';
But not working, just get a 500 error following the docs.
How do I use this pledge_schema thing to achieve this:
I required jsonApiURL from here https://github.com/Patreon/patreon-js/blob/master/src/jsonapi-url.js but then what? I get Uncaught error: pledge_schema is not defined