From b209ecb011eb42a1514557419a9231374e3b0ad2 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 8 Feb 2023 10:56:51 +0100 Subject: [PATCH 1/2] feat: create post route for debug --- loopback/common/methods/application/post.js | 17 +++++++++++++++++ loopback/common/models/application.js | 1 + loopback/common/models/application.json | 8 +++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 loopback/common/methods/application/post.js diff --git a/loopback/common/methods/application/post.js b/loopback/common/methods/application/post.js new file mode 100644 index 0000000000..9ea9a7f71d --- /dev/null +++ b/loopback/common/methods/application/post.js @@ -0,0 +1,17 @@ +module.exports = Self => { + Self.remoteMethodCtx('post', { + description: 'Returns the sent parameters', + returns: { + type: 'object', + root: true + }, + http: { + path: `/post`, + verb: 'POST' + } + }); + + Self.post = async ctx => { + return ctx.req.body; + }; +}; diff --git a/loopback/common/models/application.js b/loopback/common/models/application.js index ff7599fac4..5e767fdc11 100644 --- a/loopback/common/models/application.js +++ b/loopback/common/models/application.js @@ -1,4 +1,5 @@ module.exports = function(Self) { require('../methods/application/status')(Self); + require('../methods/application/post')(Self); }; diff --git a/loopback/common/models/application.json b/loopback/common/models/application.json index 0bb4897206..bc72df315a 100644 --- a/loopback/common/models/application.json +++ b/loopback/common/models/application.json @@ -7,6 +7,12 @@ "principalType": "ROLE", "principalId": "$everyone", "permission": "ALLOW" - } + }, + { + "property": "post", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } ] } From 3031ae251172f29f9bdf36942f2eb32138346dfe Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 16 Feb 2023 14:28:33 +0100 Subject: [PATCH 2/2] Updated version --- db/changes/{230401 => 230601}/00-acl_notifications.sql | 0 .../{230401 => 230601}/00-uniqueKeyNotificationSubscription.sql | 0 db/changes/{230401 => 230601}/01-alter_notSubs.sql | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename db/changes/{230401 => 230601}/00-acl_notifications.sql (100%) rename db/changes/{230401 => 230601}/00-uniqueKeyNotificationSubscription.sql (100%) rename db/changes/{230401 => 230601}/01-alter_notSubs.sql (100%) diff --git a/db/changes/230401/00-acl_notifications.sql b/db/changes/230601/00-acl_notifications.sql similarity index 100% rename from db/changes/230401/00-acl_notifications.sql rename to db/changes/230601/00-acl_notifications.sql diff --git a/db/changes/230401/00-uniqueKeyNotificationSubscription.sql b/db/changes/230601/00-uniqueKeyNotificationSubscription.sql similarity index 100% rename from db/changes/230401/00-uniqueKeyNotificationSubscription.sql rename to db/changes/230601/00-uniqueKeyNotificationSubscription.sql diff --git a/db/changes/230401/01-alter_notSubs.sql b/db/changes/230601/01-alter_notSubs.sql similarity index 100% rename from db/changes/230401/01-alter_notSubs.sql rename to db/changes/230601/01-alter_notSubs.sql