Skip to content

Commit

Permalink
feat: Add removeOffer from SDK (#1296)
Browse files Browse the repository at this point in the history
* Add removeOffer action

* Add offer default published state
  • Loading branch information
LEV7n authored Sep 13, 2024
1 parent 4498177 commit 6b99b4a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
12 changes: 12 additions & 0 deletions js/lib/apps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions js/lib/apps/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down

0 comments on commit 6b99b4a

Please sign in to comment.