ethanresnick / json-api

Turn your node app into a JSON API server (http://jsonapi.org/)
GNU Lesser General Public License v3.0
268 stars 41 forks source link

Update adapter method return types #164

Closed ethanresnick closed 6 years ago

ethanresnick commented 6 years ago

Using the final types @carlbennettnz and I discussed in #139:

find: Promise<{ primary: Data<Resource>, included?: Resource[], collectionSize?: number }>
create: Promise<{ created: Data<Resource> }>
update: Promise<{ updated: Data<Resource> }>
delete: Promise<{}>
addToRelationship: Promise<{ before?: Relationship, after?: Relationship }>
removeFromRelationship: Promise<{ before?: Relationship, after?: Relationship }>