From 6b99b4a256bab3a44e3c35c3c47b0662b1beb191 Mon Sep 17 00:00:00 2001 From: LEV7n Date: Fri, 13 Sep 2024 11:34:01 +0500 Subject: [PATCH] feat: Add removeOffer from SDK (#1296) * Add removeOffer action * Add offer default published state --- js/kit.js | 2 +- js/lib/apps/index.js | 12 ++++++++++++ js/lib/apps/sdk.js | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/js/kit.js b/js/kit.js index 9c4e877e4..6e2ca2f4c 100644 --- a/js/kit.js +++ b/js/kit.js @@ -2260,7 +2260,7 @@ brtOffer = function(){ self.images = []; self.geohash = ''; self.price = 0; - self.published = 1; + self.published = 'published'; self.validation = function(){ if(!self.address) return 'address'; diff --git a/js/lib/apps/index.js b/js/lib/apps/index.js index c1dd129ba..1914b6693 100644 --- a/js/lib/apps/index.js +++ b/js/lib/apps/index.js @@ -721,6 +721,18 @@ var BastyonApps = function(app){ } }, + removeOffer : { + permissions : ['account'], + authorization : true, + action : function({data, application}){ + var remove = new Remove(); + + remove.import({ txidEdit: data.hash }); + + return makeAction(remove, application, true); + } + }, + comment : { permissions : ['account'], authorization : true, diff --git a/js/lib/apps/sdk.js b/js/lib/apps/sdk.js index 8f7d6ccdd..57649eda0 100644 --- a/js/lib/apps/sdk.js +++ b/js/lib/apps/sdk.js @@ -280,6 +280,10 @@ var BastyonSdk = function(){ return action('barteron.offer', data) }, + removeOffer : function(data){ + return action('barteron.removeOffer', data) + }, + comment : function(data){ return action('barteron.comment', data) },