export class DeletePostCommandHandler {
  constructor(postRepository) {
    this.postRepository = postRepository;
  }

  async handle(command) {
    const result = await this.postRepository.delete(command.id);
    if (!result) {
      throw new Error('Post not found');
    }
    return result;
  }
}
