sarala
Version:
Javascript library to communicate with RESTful API built following JSON API specification. inspired by Laravel’s Eloquent.
21 lines (17 loc) • 400 B
JavaScript
import Model from './BaseModel'
import Comment from './Comment'
import User from './User'
export default class PostNoTagRelation extends Model {
resourceName () {
return 'posts'
}
fields () {
return ['title', 'subtitle', 'body', 'slug']
}
relationships () {
return {
author: new User(),
comments: new Comment()
}
}
}