Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

726 B
Raw Blame
import httpStatus from 'http-status';
import { ExpressHandler, ExpressHandlerWithParams } from '../../../../types';
import { subscriptionService } from '../services';
import ApiError from '../../../utils/apiError';
import { authExpressHelpers } from '../../auth/helpers/auth-express.helper';

export const getTeamsSubs: ExpressHandler<{}, { teamsSubs: any }> = async (req, res) => {
  const parentTeamId = authExpressHelpers.getParentTeamId(res);
  const includeObject: boolean = req.query.includeObject === 'true';

  const teamsSubs = await subscriptionService.getTeamSubs(parentTeamId, {}, includeObject);

  return res.status(httpStatus.OK).json({
    message: 'Teams Subs retrieved successfully',
    teamsSubs,
  });
};