Created
August 28, 2018 10:33
-
-
Save mihailsitnic/839193f0a45a4ad029129003c2eb4ed3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// В деректории resources/assets/js/admin/Api я создал файл Services.js | |
import '../core'; | |
import Router from '../../common/Router'; | |
import makeForm from './shared/jsonFromJqueryForm'; | |
export default class Services { | |
static index() { | |
return $.get(Router.name('service.index')); | |
} | |
static store(id, data) { | |
return $.get(Router.name('service.store', id), makeForm(data)); | |
} | |
static show() { | |
return $.post(Router.name('service.show')); | |
} | |
static update(id, data) { | |
return $.put(Router.name('service.update', id), makeForm(data)); | |
} | |
static destroy(id, data) { | |
return $.delete(Router.name('service.destroy', id), makeForm(data)); | |
} | |
} | |
// В файле resources/assets/js/admin/pages/services.js я импортирую его |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment