Skip to content

Commit

Permalink
Implemented pending action delete-account (#12508)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortes authored Jun 21, 2024
1 parent 5491cfa commit 051ad0e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions components/badger_maps/actions/delete-account/delete-account.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import app from "../../badger_maps.app.mjs";

export default {
key: "badger_maps-delete-account",
name: "Delete Account",
description: "Deletes an account. [See the docs](https://badgerupdatedapi.docs.apiary.io/#reference/accounts/retrieve-and-update-account-details/delete-customer).",
type: "action",
version: "0.0.1",
props: {
app,
accountId: {
propDefinition: [
app,
"accountId",
],
},
},
methods: {
deleteAccount({
accountId, ...args
} = {}) {
return this.app.delete({
path: `/customers/${accountId}/`,
...args,
});
},
},
async run({ $: step }) {
const {
deleteAccount,
accountId,
} = this;

const response = await deleteAccount({
step,
accountId,
});

step.export("$summary", `Successfully deleted account with ID ${accountId}.`);

return response || {
success: true,
};
},
};
2 changes: 1 addition & 1 deletion components/badger_maps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/badger_maps",
"version": "0.0.3",
"version": "0.1.0",
"description": "Pipedream Badger Maps Components",
"main": "badger_maps.app.mjs",
"keywords": [
Expand Down

0 comments on commit 051ad0e

Please sign in to comment.