feat(alerts): EE changed build script

feat(api): EE changed get roles
This commit is contained in:
Taha Yassine Kraiem 2022-01-12 11:07:29 +01:00
parent 99c31f2090
commit 0f44ae1909
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ function make_submodule() {
[[ $1 == "ee" ]] && {
# -- this part was generated by modules_lister.py --
mkdir alerts
cp -R ./{app_alerts,schemas}.py ./alerts/
cp -R ./{app_alerts,schemas,schemas_ee}.py ./alerts/
mkdir -p ./alerts/chalicelib/
cp -R ./chalicelib/__init__.py ./alerts/chalicelib/
mkdir -p ./alerts/chalicelib/core/

View file

@ -96,7 +96,7 @@ def create(tenant_id, user_id, data: schemas_ee.RolePayloadSchema):
def get_roles(tenant_id):
with pg_client.PostgresClient() as cur:
cur.execute(
cur.mogrify("""SELECT *, COALESCE(projects, '{}') AS projects
cur.mogrify("""SELECT roles.*, COALESCE(projects, '{}') AS projects
FROM public.roles
LEFT JOIN LATERAL (SELECT array_agg(project_id) AS projects
FROM roles_projects