fixed wrong response in dsync events (#2619)

This commit is contained in:
Deepak Prabhakara 2024-04-25 17:40:30 +01:00 committed by GitHub
parent 50aa00aec2
commit 663eca577f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

View File

@ -55,7 +55,7 @@ const handleGET = async (req: NextApiRequest, res: NextApiResponse) => {
directoryId: searchParams.directoryId,
});
return res.json({ data: events });
return res.json(events);
};
// Delete webhook events for a directory

View File

@ -41,16 +41,16 @@ const handleGET = async (req: NextApiRequest, res: NextApiResponse) => {
product = directory.product;
}
const { data, error } = await directorySyncController.groups.setTenantAndProduct(tenant, product).getAll({
const groups = await directorySyncController.groups.setTenantAndProduct(tenant, product).getAll({
pageOffset,
pageLimit,
pageToken,
directoryId: searchParams.directoryId,
});
if (error) {
return res.status(error.code).json({ error });
if (groups.error) {
return res.status(groups.error.code).json({ error: groups.error });
}
return res.status(200).json({ data });
return res.status(200).json(groups);
};

View File

@ -41,16 +41,16 @@ const handleGET = async (req: NextApiRequest, res: NextApiResponse) => {
product = directory.product;
}
const { data, error } = await directorySyncController.users.setTenantAndProduct(tenant, product).getAll({
const users = await directorySyncController.users.setTenantAndProduct(tenant, product).getAll({
pageOffset,
pageLimit,
pageToken,
directoryId: searchParams.directoryId,
});
if (error) {
return res.status(error.code).json({ error });
if (users.error) {
return res.status(users.error.code).json({ error: users.error });
}
return res.status(200).json({ data });
return res.status(200).json(users);
};