add sorting to protocol agenda, decision and votings
This commit is contained in:
parent
4b6f0b34df
commit
2e5b345daa
22 changed files with 138 additions and 16 deletions
|
@ -39,4 +39,22 @@ export default abstract class ProtocolAgendaService {
|
|||
throw new DatabaseActionException("SELECT", "protocolAgenda", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get count of exisiting protocolAgenda by protocolId
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
static async getInstanceCount(protocolId: number): Promise<number> {
|
||||
return await dataSource
|
||||
.getRepository(protocolAgenda)
|
||||
.createQueryBuilder("protocolAgenda")
|
||||
.where({ protocolId })
|
||||
.getCount()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("COUNT", "protocolAgenda", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,22 @@ export default abstract class ProtocolDecisionService {
|
|||
throw new DatabaseActionException("SELECT", "protocolDecision", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get count of exisiting protocolDecision by protocolId
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
static async getInstanceCount(protocolId: number): Promise<number> {
|
||||
return await dataSource
|
||||
.getRepository(protocolDecision)
|
||||
.createQueryBuilder("protocolDecisions")
|
||||
.where({ protocolId })
|
||||
.getCount()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("COUNT", "protocolDecision", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,22 @@ export default abstract class ProtocolVotingService {
|
|||
throw new DatabaseActionException("SELECT", "protocolVoting", err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get count of exisiting protocolVoting by protocolId
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
static async getInstanceCount(protocolId: number): Promise<number> {
|
||||
return await dataSource
|
||||
.getRepository(protocolVoting)
|
||||
.createQueryBuilder("protocolVotings")
|
||||
.where({ protocolId })
|
||||
.getCount()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("COUNT", "protocolVoting", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue