Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Api from '../../common/services/Api'
- export default class BlogPostService {
- constructor () {
- this.api = new Api('blog_post')
- }
- fetchAll (businessId) {
- return this.api.fetchAll({
- business: businessId
- })
- }
- retrieve (businessId, id) {
- return this.api.fetch({
- id: id,
- business: businessId
- })
- }
- remove (businessId, model) {
- return this.api.remove({
- id: model.id,
- business: businessId
- })
- }
- save (business, values) {
- let params = Object.assign({}, values)
- delete params.id
- delete params.createdAt
- if (values.id) {
- return this.api.update({id: values.id, business: business}, params)
- }
- return this.api.create({business: business}, params)
- }
- }
Add Comment
Please, Sign In to add comment