fix : User history fix for returning most recently executed 50 user history REST/GraphQL items (HBE-165) (#27)
* chore: updated fetchUserHistory operation to return recently executed 50 entries * chore: updated history to use PaginationArgs for operation * chore: updated GraphQL resolver name
This commit is contained in:
@@ -19,15 +19,20 @@ export class UserHistoryService {
|
||||
/**
|
||||
* Fetch users REST or GraphQL history based on ReqType param.
|
||||
* @param uid Users uid
|
||||
* @param take items to fetch
|
||||
* @param reqType request Type to fetch i.e. GraphQL or REST
|
||||
* @returns an array of user history
|
||||
*/
|
||||
async fetchUserHistory(uid: string, reqType: ReqType) {
|
||||
async fetchUserHistory(uid: string, take: number, reqType: ReqType) {
|
||||
const userHistory = await this.prisma.userHistory.findMany({
|
||||
where: {
|
||||
userUid: uid,
|
||||
reqType: reqType,
|
||||
},
|
||||
take: take,
|
||||
orderBy: {
|
||||
executedOn: 'desc',
|
||||
},
|
||||
});
|
||||
|
||||
const userHistoryColl: UserHistory[] = userHistory.map(
|
||||
|
||||
Reference in New Issue
Block a user