Skip to content

Commit

Permalink
add rest properties
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Jul 7, 2019
1 parent 9f0c528 commit ee97a4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/moleculer-db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
--------------------------------------------------
<a name="0.8.1"></a>
# 0.8.1 (2019-07-07)

## Changes
- update dependencies
- add rest properties for CRUD actions

--------------------------------------------------
<a name="0.8.0"></a>
# 0.8.0 (2019-07-01)
Expand Down
5 changes: 5 additions & 0 deletions packages/moleculer-db/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ module.exports = {
cache: {
keys: ["populate", "fields", "page", "pageSize", "sort", "search", "searchFields", "query"]
},
rest: "GET /",
params: {
populate: [
{ type: "string", optional: true },
Expand Down Expand Up @@ -197,6 +198,7 @@ module.exports = {
* @returns {Object} Saved entity.
*/
create: {
rest: "POST /",
handler(ctx) {
let params = ctx.params;
return this._create(ctx, params);
Expand Down Expand Up @@ -243,6 +245,7 @@ module.exports = {
cache: {
keys: ["id", "populate", "fields", "mapping"]
},
rest: "GET /:id",
params: {
id: [
{ type: "string" },
Expand Down Expand Up @@ -279,6 +282,7 @@ module.exports = {
* @throws {EntityNotFoundError} - 404 Entity not found
*/
update: {
rest: "PUT /:id",
handler(ctx) {
let params = ctx.params;
return this._update(ctx, params);
Expand All @@ -296,6 +300,7 @@ module.exports = {
* @throws {EntityNotFoundError} - 404 Entity not found
*/
remove: {
rest: "DELETE /:id",
params: {
id: { type: "any" }
},
Expand Down

0 comments on commit ee97a4c

Please sign in to comment.