I couldn't find why I get this error:
And here is my code:
create: async (data) => {
const insertedData = await dbProvider.query('INSERT INTO users SET ?', data);
console.log(this);
return await this.getById(insertedData.insertId);
},
getById: async (id) => {
const data = await dbProvider.query('SELECT * From users WHERE id = ?', id);
return data;
},
Create gets called with await repo.create(data); the create calls this.getById which results in an error. Any idea why this happens?