import { DataSource } from 'typeorm';
import { AuthUserEntity } from '../../../entities';

export async function handleUpdateUserPasswordHash(
  dataSource: DataSource,
  userId: string,
  passwordHash: string
): Promise<void> {
  const repo = dataSource.getRepository(AuthUserEntity);

  await repo.update({ id: userId }, { passwordHash });
}
