14 lines
484 B
TypeScript
14 lines
484 B
TypeScript
import { DataSource } from 'typeorm';
|
|
import { PluginDataEntity } from '../../../entities';
|
|
import { DeletePluginDataCommand } from '../../types';
|
|
|
|
export async function handleDeletePluginData(command: DeletePluginDataCommand, dataSource: DataSource): Promise<void> {
|
|
const { payload } = command;
|
|
|
|
await dataSource.getRepository(PluginDataEntity).delete({
|
|
key: payload.key,
|
|
pluginId: payload.pluginId,
|
|
scope: payload.scope,
|
|
serverId: payload.serverId ?? ''
|
|
});
|
|
} |