Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

admin-config

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

admin-config - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

.jshintrc

15

lib/Entity/Entity.js

@@ -26,3 +26,6 @@ import stringUtils from "../Utils/stringUtils";

this._url = null;
this._createMethod = null; // manually set the HTTP-method for create operation, defaults to post
this._updateMethod = null; // manually set the HTTP-method for update operation, defaults to put
this._initViews();

@@ -198,4 +201,16 @@ }

}
createMethod(createMethod) {
if (!arguments.length) return this._createMethod;
this._createMethod = createMethod;
return this;
}
updateMethod(updateMethod) {
if (!arguments.length) return this._updateMethod;
this._updateMethod = updateMethod;
return this;
}
}
export default Entity;

4

lib/Queries/WriteQueries.js

@@ -16,3 +16,3 @@ import Queries from './Queries'

return this._restWrapper
.createOne(rawEntity, view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(), view.type));
.createOne(rawEntity, view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(), view.type), view.entity.createMethod());
}

@@ -35,3 +35,3 @@

return this._restWrapper
.updateOne(rawEntity, view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(entityId), view.type, entityId, view.identifier()));
.updateOne(rawEntity, view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(entityId), view.type, entityId, view.identifier()), view.entity.updateMethod());
}

@@ -38,0 +38,0 @@

{
"name": "admin-config",
"version": "0.1.6",
"version": "0.1.7",
"private": false,

@@ -5,0 +5,0 @@ "repository": {

@@ -64,2 +64,26 @@ var assert = require('chai').assert;

})
describe('createMethod', function() {
it('should return given createMethod if already set', function() {
var post = new Entity('post').createMethod("put");
assert.equal('put', post.createMethod());
});
it('should return null if no createMethod has been set', function() {
var post = new Entity('post');
assert.equal(null, post.createMethod());
});
});
describe('updateMethod', function() {
it('should return given updateMethod if already set', function() {
var post = new Entity('post').updateMethod("post");
assert.equal('post', post.updateMethod());
});
it('should return null if no updateMethod has been set', function() {
var post = new Entity('post');
assert.equal(null, post.updateMethod());
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc