# On comment next() save button keeps loading not getting any response

**URL:** https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724
**Category:** Help me!
**Created:** [June 17, 2021, 4:32pm UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724 "2021-06-17T16:32:43Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sourabht](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sourabht](https://community.forestadmin.com/u/sourabht)
#### Post date: [June 17, 2021, 4:32pm UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/1 "2021-06-17T16:32:43Z")

</div>

Hi Team,

I want to perform the action on database update or create should be done by third party API not with forestadmin.

below is the code here I commented the next() to stop automated operation perform by forestadmin. but after save it keeps loading.

```javascript
axios({
      url: 'http://localhost:8000/api/v1/settings',
      method: 'post',
      data: data,
    })
    .then(async (result) => {
      // console.log(result);
      await RecordUpdaterM.serialize(result.data)
      response.send("sucess");
    })
    .catch((error) => {
      console.log('error:', error);
    });
    // next();

```

Thanks,  
Sourabh

---

<div class="post-metadata">

### Author: ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)
#### Post date: [June 18, 2021, 8:14am UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/2 "2021-06-18T08:14:09Z")

</div>

Hi @sourabht,

Thanks for your message.

Could you tell me what route kind you’re trying to replace?  
Did you try to send the result in the response?  
Like:

```javascript
    .then(async (result) => {
      response.send(await RecordUpdaterM.serialize(result.data));
    })

```

Thanks!

---

<div class="post-metadata">

### Author: ![sourabht](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sourabht](https://community.forestadmin.com/u/sourabht)
#### Post date: [June 18, 2021, 8:18am UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/3 "2021-06-18T08:18:23Z")

</div>

Yes i tried the same but not resolved.

---

<div class="post-metadata">

### Author: ![anon34731316](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@anon34731316](https://community.forestadmin.com/u/anon34731316)
#### Post date: [June 18, 2021, 8:34am UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/4 "2021-06-18T08:34:39Z")

</div>

Is it a POST route that you are overriding?  
Are you not using the RecordCreator serializer as specified in the documentation?

```javascript
const { RecordCreator } = require('forest-express-mongoose');
  const recordCreator = new RecordCreator(users);

  ...

    .then(async (result) => {
      response.send(await recordCreator.serialize(result.data));

```

---

<div class="post-metadata">

### Author: ![sourabht](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sourabht](https://community.forestadmin.com/u/sourabht)
#### Post date: [June 18, 2021, 10:14am UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/5 "2021-06-18T10:14:09Z")

</div>

Hi @anon34731316 ,

I have successfully integrated the API call using the override route.

but after getting a successful response it redirects me to the details page and there it showed me the old records. Once I will reload the list page then i can get the latest data on click on particular record. this issue coming on add and update both. below are the screen shot.

old record:

 ![Screenshot_20210618_153431](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/6/61ffd6f53c03490db791fad47b31d72a1a32ab59.png)

After refresh page new record:

 ![Screenshot_20210618_153516](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/4/448d2f38a30615648ed966877a3c207f3185271e.png)

Below are the code snippt.

```javascript
router.post('/media', permissionMiddlewareCreator.create(), (request, response, next) => {
  // Learn what this route does here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/routes/default-routes#create-a-record
  const recordCreator = new RecordCreator(media);
  const data = request.body.data.attributes;

  axios({
    url: 'http://localhost:8000/media',
    method: 'post',
    data: data,
  })
    .then(async (result) => {
      response.send(await recordCreator.serialize(result.data));
    })
    .catch((error) => {
      console.log('error:', error);
    });
    
    // next();
});

```

Thanks,  
Sourabh

---

<div class="post-metadata">

### Author: ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)
#### Post date: [June 18, 2021, 1:13pm UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/6 "2021-06-18T13:13:56Z")

</div>

Hi @sourabht 👋 have you take a look on the response payload on your browser console?  
In case of update record ForestAdmin need the full new record to update it.

---

<div class="post-metadata">

### Author: ![sourabht](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sourabht](https://community.forestadmin.com/u/sourabht)
#### Post date: [June 18, 2021, 1:56pm UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/7 "2021-06-18T13:56:34Z")

</div>

![Screenshot_20210618_192338](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/b707a73196b88f3f0d76561701d64430e5e3d94d.png)

I got the above response on update record. also i get the issue when i update this and went to the listing and again click on the particular row then getting below the page.

 ![Screenshot_20210618_192559](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/6/6fac54bb65d859b873f672365455502d95e30f65.png)

and i reload on same page then updated data i am able to see.

Thank you.  
Sourabh

---

<div class="post-metadata">

### Author: ![Arnaud\_Moncel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud_moncel/32/24_2.png) [@Arnaud\_Moncel](https://community.forestadmin.com/u/Arnaud_Moncel)
#### Post date: [June 18, 2021, 2:52pm UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/8 "2021-06-18T14:52:24Z")

</div>

> [@Arnaud\_Moncel](#):
>
> In case of update record ForestAdmin need the full new record to update it.

To be more explicite! You must return the updated record in your payload. Not `{ sucess: true }`.

---

<div class="post-metadata">

### Author: ![sourabht](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sourabht](https://community.forestadmin.com/u/sourabht)
#### Post date: [June 25, 2021, 1:13pm UTC](https://community.forestadmin.com/t/on-comment-next-save-button-keeps-loading-not-getting-any-response/2724/9 "2021-06-25T13:13:06Z")

</div>

I got the solution below is the code.

`response.send(await recordCreator.serialize(result.data.data));`
