import { DataSource } from 'typeorm';
import { MetaEntity } from '../../../entities';
import { SaveMetaCommand } from '../../types';

export async function handleSaveMeta(command: SaveMetaCommand, dataSource: DataSource): Promise<void> {
  await dataSource.getRepository(MetaEntity).save({
    key: command.payload.key,
    value: command.payload.value
  });
}
