RHeactorJS/server

View on GitHub
src/command-handler/repository/user/create.js

Summary

Maintainability
A
0 mins
Test Coverage
import {CreateUserCommand} from '../../../command/user/create'

export default {
  command: CreateUserCommand,
  /**
   * @param {UserRepository} repository
   * @param {CreateUserCommand} cmd
   * @return {UserCreatedEvent}
   */
  handler: (repository, cmd) => repository.add({...cmd, isActive: cmd.active}, cmd.author)
}