mirror of https://github.com/boxyhq/jackson.git
fixed wrong response in dsync events (#2619)
This commit is contained in:
parent
50aa00aec2
commit
663eca577f
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue