change(api): tenant_id usage
This commit is contained in:
parent
11a2ea48bc
commit
307b0c1cd8
2 changed files with 4 additions and 3 deletions
|
|
@ -74,7 +74,7 @@ def get_all_notes_by_project_id(tenant_id, project_id, user_id, data: schemas.Se
|
|||
|
||||
# filter by ownership or shared status
|
||||
if data.shared_only:
|
||||
conditions.append("sessions_notes.is_public")
|
||||
conditions.append("sessions_notes.is_public IS TRUE")
|
||||
elif data.mine_only:
|
||||
conditions.append("sessions_notes.user_id = %(user_id)s")
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@ def get_all_notes_by_project_id(tenant_id, project_id, user_id, data: schemas.Se
|
|||
# base conditions
|
||||
conditions = [
|
||||
"sessions_notes.project_id = %(project_id)s",
|
||||
"sessions_notes.deleted_at IS NULL"
|
||||
"sessions_notes.deleted_at IS NULL",
|
||||
"users.tenant_id = %(tenant_id)s"
|
||||
]
|
||||
params = {"project_id": project_id, "user_id": user_id, "tenant_id": tenant_id}
|
||||
|
||||
|
|
@ -75,7 +76,7 @@ def get_all_notes_by_project_id(tenant_id, project_id, user_id, data: schemas.Se
|
|||
|
||||
# filter by ownership or shared status
|
||||
if data.shared_only:
|
||||
conditions.append("sessions_notes.is_public")
|
||||
conditions.append("sessions_notes.is_public IS TRUE")
|
||||
elif data.mine_only:
|
||||
conditions.append("sessions_notes.user_id = %(user_id)s")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue