import { AbstractCRUDRepository } from '@/base_repositories/AbstractCRUDRepository';
import { Api } from './Api';
export class TestCRUDRepository extends AbstractCRUDRepository {
    constructor() {
        super(...arguments);
        this.addMiddlewares = [];
        this.deleteMiddlewares = [];
        this.deleteByIdMiddlewares = [];
        this.editMiddlewares = [];
        this.editBatchMiddlewares = [];
        this.getMiddlewares = [];
        this.listMiddlewares = [];
    }
    async sendAddReq(instance) {
        const resp = await Api.sendAddReq(instance);
        this.addMiddlewares.forEach(mw => mw(resp));
        return resp;
    }
    async sendDeleteReq(instance) {
        const resp = await Api.sendDeleteReq(instance);
        this.deleteMiddlewares.forEach(mw => mw(resp));
        return resp;
    }
    async sendEditReq(instance) {
        const resp = await Api.sendEditReq(instance);
        this.editMiddlewares.forEach(mw => mw(resp));
        return resp;
    }
    async sendGetReq(id) {
        const resp = await Api.sendGetReq(id);
        this.getMiddlewares.forEach(mw => mw(resp));
        return resp;
    }
    async sendListReq() {
        const resp = await Api.sendListReq();
        this.listMiddlewares.forEach(mw => mw(resp));
        return resp;
    }
}
//# sourceMappingURL=TestCRUDRepository.js.map