# Updating Data in Plugin with JS

**URL:** https://meta.discourse.org/t/updating-data-in-plugin-with-js/235652
**Category:** Development
**Created:** [August 9, 2022, 8:27pm UTC](https://meta.discourse.org/t/updating-data-in-plugin-with-js/235652 "2022-08-09T20:27:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Alshain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alshain/32/268446_2.png) [@Alshain](https://meta.discourse.org/u/Alshain)
#### Post date: [August 9, 2022, 8:27pm UTC](https://meta.discourse.org/t/updating-data-in-plugin-with-js/235652/1 "2022-08-09T20:27:09Z")

</div>

Hello friends,

I’m trying to write a plugin in Discourse but I couldn’t update the data. There is no problem with adding and deleting data. It does this successfully.

I’ve been struggling for hours, but only this part is left in the plugin. If I do this too it will be over 🙂

Commands like destroyRecord and createRecord are for adding/deleting, but I couldn’t find which code to use for the update. I want to update other data except ID.

There may be an update command, but I couldn’t figure out how it works either.

Is there anyone who can help me with this? I’m stuck on the updatePayment section.

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/c/1/6c15273ab1bf14bbe7b4bfca0624e4778f597526.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 9, 2022, 10:01pm UTC](https://meta.discourse.org/t/updating-data-in-plugin-with-js/235652/2 "2022-08-09T22:01:26Z")

</div>

I’m not especially got at the front end stuff, but you’re going to need to make API calls from the front end to the Discourse API endpoints.

---

<div class="post-metadata">

### Author: ![Alshain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alshain/32/268446_2.png) [@Alshain](https://meta.discourse.org/u/Alshain)
#### Post date: [August 10, 2022, 3:59am UTC](https://meta.discourse.org/t/updating-data-in-plugin-with-js/235652/3 "2022-08-10T03:59:50Z")

</div>

but post editing process etc. is done from the interface. that is, not necessarily post, other editing operations can be done from the interface. Shouldn’t that be too?
