Await not working

  async addTransaction() {
    this.ref = this.db.list('transactions', ref => ref.orderByChild('month'));
    this.ref.push(this.transaction).then(() => {
      this.transaction = {
        value: 0,
        expense: false,
        month: 0,
      };
      let toast = await this.toastCtrl.create({
        message: 'New transaction has been added!',
        duration: 3000
      });
      return await toast.present()
   });
  }

It tells me that await has to be inside an async function and it is. I don’t know what the issue is

Your addTransaction() is async, but you use .then( ()=> {...}) which is a resolving promise that is not async

You could try

await this.ref.push(this.transaction)
this.transaction = {...};
let toast = await this.toastCtrl.create(...)

thank you for replying to my question

The toast await is actually not in an async. The fat arrow function in the then after the push should have the word async before the ()=>

As alternative suggestion