Patch actionNames on getWorkspacelogs

This commit is contained in:
Tuan Dang
2023-01-02 15:43:21 +07:00
parent 029443161f
commit 4af839040e

View File

@@ -41,10 +41,11 @@ export const getWorkspaceLogs = async (req: Request, res: Response) => {
let logs
try {
const { workspaceId } = req.params;
const { userId, actionNames } = req.query;
const offset: number = parseInt(req.query.offset as string);
const limit: number = parseInt(req.query.limit as string);
const userId: string = req.query.userId as string;
const actionNames: string = req.query.actionNames as string;
logs = await Log.find({
workspace: workspaceId,
@@ -53,7 +54,7 @@ export const getWorkspaceLogs = async (req: Request, res: Response) => {
actionNames
? {
actionNames: {
$in: actionNames
$in: actionNames.split(',')
}
} : {}
)