Only show communications that are 'new' or 'opened'
This commit is contained in:
parent
27596aff20
commit
3a3cd78cac
1 changed files with 6 additions and 1 deletions
|
|
@ -28,7 +28,12 @@ func CommunicationsFromOrganization(ctx context.Context, org_id int64) ([]model.
|
||||||
statement := table.Communication.SELECT(
|
statement := table.Communication.SELECT(
|
||||||
table.Communication.AllColumns,
|
table.Communication.AllColumns,
|
||||||
).FROM(table.Communication).
|
).FROM(table.Communication).
|
||||||
WHERE(table.Communication.OrganizationID.EQ(postgres.Int(org_id))).
|
WHERE(
|
||||||
|
table.Communication.OrganizationID.EQ(postgres.Int(org_id)).AND(
|
||||||
|
table.Communication.Status.EQ(postgres.NewEnumValue(
|
||||||
|
model.Communicationstatus_New.String())).OR(
|
||||||
|
table.Communication.Status.EQ(postgres.NewEnumValue(
|
||||||
|
model.Communicationstatus_Opened.String()))))).
|
||||||
ORDER_BY(table.Communication.Created.DESC())
|
ORDER_BY(table.Communication.Created.DESC())
|
||||||
return db.ExecuteMany[model.Communication](ctx, statement)
|
return db.ExecuteMany[model.Communication](ctx, statement)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue