Sort communication by recency
This commit is contained in:
parent
93510e4b2e
commit
d1935d31af
1 changed files with 2 additions and 1 deletions
|
|
@ -28,7 +28,8 @@ 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))).
|
||||||
|
ORDER_BY(table.Communication.Created.DESC())
|
||||||
return db.ExecuteMany[model.Communication](ctx, statement)
|
return db.ExecuteMany[model.Communication](ctx, statement)
|
||||||
}
|
}
|
||||||
func CommunicationSetStatus(ctx context.Context, txn db.Tx, org_id int64, comm_id int64, status model.Communicationstatus) error {
|
func CommunicationSetStatus(ctx context.Context, txn db.Tx, org_id int64, comm_id int64, status model.Communicationstatus) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue