Complete the code to import the repository class correctly.
import [1] from '@/repositories/UserRepository';
The repository class is named UserRepository and should be imported with the exact name.
Complete the code to create a new instance of the repository.
const userRepo = new [1]();The instance must be created from the UserRepository class with exact casing.
Fix the error in the method call to fetch all users.
const users = await userRepo.[1]();The repository method to get all users is named findAll following common repository patterns.
Fill both blanks to define a repository method that finds a user by ID.
async findById([1]) { return await this.[2].findOne({ where: { id } }); }
The method parameter is id and the repository instance is commonly named repository.
Fill all three blanks to create a new user using the repository pattern.
async createUser([1]) { const newUser = this.[2].create([3]); await this.repository.save(newUser); return newUser; }
The method takes userData as input, uses this.repository to create, and passes userData to create.