I’ve created the table named as verification-code which is linked with user table. Need to create entry into the verification-code table with relevant user.
Here is my code
const user = await strapi.db.query(‘plugin::users-permissions.user’).findOne({ email });
if (!user) {
return ctx.throw(400, ‘User not found’);
}
const resetCode = Math.floor(1000 + Math.random() * 9000).toString();
await strapi.db.query('api::verification-code').create({
data: {
code: resetCode,
user: user.id,
},
});
It gives me the error as
Error: Model api::verification-code not found