This commit is contained in:
parent
f98af40bd6
commit
210a9eee74
|
@ -145,6 +145,9 @@ export default class AbstractService {
|
|||
* @returns {Q.Promise<any>}
|
||||
*/
|
||||
get(model, params = {}) {
|
||||
if (this.paths.get === '') {
|
||||
return Promise.reject({message: 'This model is not able to get data.'})
|
||||
}
|
||||
|
||||
// We later will be able to cancel the loading indicator using this.
|
||||
const cancel = this.setLoading()
|
||||
|
@ -168,6 +171,10 @@ export default class AbstractService {
|
|||
* @returns {Promise<any | never>}
|
||||
*/
|
||||
create(model) {
|
||||
if (this.paths.create === '') {
|
||||
return Promise.reject({message: 'This model is not able to create data.'})
|
||||
}
|
||||
|
||||
const cancel = this.setLoading()
|
||||
|
||||
// Finally make the request and get our data.
|
||||
|
@ -189,6 +196,9 @@ export default class AbstractService {
|
|||
* @returns {Q.Promise<any>}
|
||||
*/
|
||||
update(model) {
|
||||
if (this.paths.update === '') {
|
||||
return Promise.reject({message: 'This model is not able to update data.'})
|
||||
}
|
||||
const cancel = this.setLoading()
|
||||
|
||||
// Finally make the request and get our data.
|
||||
|
|
Reference in New Issue
Block a user