Resolve promise after the insert is written.

When inserting it only confirmed it got the data, and not written the data. So the promise needs to solve after the transaction, not the general success.