mirror of
https://github.com/aditama-labs/nest-autocrud.git
synced 2025-02-08 17:18:38 +00:00
19 lines
604 B
TypeScript
19 lines
604 B
TypeScript
|
import { UpdateProcess } from '../processes';
|
||
|
import { DefaultExecutor } from './default.executor';
|
||
|
|
||
|
// @TODO: This executor should be able to extend from ReadExecutor and CreateExecutor
|
||
|
export class UpdateExecutor extends DefaultExecutor {
|
||
|
constructor(process: UpdateProcess, id, data) {
|
||
|
super(process);
|
||
|
// Set the id and data to process
|
||
|
process.id = id;
|
||
|
process.data = data;
|
||
|
}
|
||
|
|
||
|
static async bootstrap(process: UpdateProcess, id, data): Promise<any> {
|
||
|
const executor = new UpdateExecutor(process, id, data);
|
||
|
await executor.execute();
|
||
|
return executor.getOutput();
|
||
|
}
|
||
|
}
|