Skip to content

Commit e4a13ba

Browse files
committed
chore(): moves style warning to $send
1 parent 7934001 commit e4a13ba

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/module/api/common-api.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
RMModule.factory('RMCommonApi', ['$http', '$q', 'RMPackerCache', function($http, $q, packerCache) {
3+
RMModule.factory('RMCommonApi', ['$http', '$q', '$log', 'RMPackerCache', function($http, $q, $log, packerCache) {
44

55
var EMPTY_ARRAY = [];
66

@@ -322,6 +322,11 @@ RMModule.factory('RMCommonApi', ['$http', '$q', 'RMPackerCache', function($http,
322322
*/
323323
$send: function(_options, _success, _error) {
324324

325+
// make sure a style base was selected for the model
326+
if(!this.$getProperty('style')) {
327+
$log.warn('No API style base was selected, see the Api Integration FAQ for more information on this warning');
328+
}
329+
325330
this.$pending = (this.$pending || []);
326331
this.$pending.push(_options);
327332

src/module/factory.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
RMModule.factory('RMModelFactory', ['$injector', '$log', 'inflector', 'RMUtils', 'RMScopeApi', 'RMCommonApi', 'RMRecordApi', 'RMCollectionApi', 'RMExtendedApi', 'RMSerializer', 'RMBuilder',
4-
function($injector, $log, inflector, Utils, ScopeApi, CommonApi, RecordApi, CollectionApi, ExtendedApi, Serializer, Builder) {
3+
RMModule.factory('RMModelFactory', ['$injector', 'inflector', 'RMUtils', 'RMScopeApi', 'RMCommonApi', 'RMRecordApi', 'RMCollectionApi', 'RMExtendedApi', 'RMSerializer', 'RMBuilder',
4+
function($injector, inflector, Utils, ScopeApi, CommonApi, RecordApi, CollectionApi, ExtendedApi, Serializer, Builder) {
55

66
var NAME_RGX = /(.*?)([^\/]+)\/?$/,
77
extend = Utils.extendOverriden;
@@ -21,12 +21,6 @@ RMModule.factory('RMModelFactory', ['$injector', '$log', 'inflector', 'RMUtils',
2121
hooks = {},
2222
builder; // the model builder
2323

24-
// make sure a style base was selected for the model
25-
26-
// if(!internal.style) {
27-
// $log.warn('No API style base was included, see the Api Integration Guide.');
28-
// }
29-
3024
// make sure the resource name and plural name are available if posible:
3125

3226
if(!config.name && _baseUrl) {

0 commit comments

Comments
 (0)