Start work on populating context of communication at API layer
Remove communication stub, it's a performance enhancement.
This commit is contained in:
parent
266004624d
commit
e569bb32b7
9 changed files with 331 additions and 119 deletions
|
|
@ -16,3 +16,11 @@ func TextLogFromID(ctx context.Context, id int64) (model.TextLog, error) {
|
|||
WHERE(table.TextLog.ID.EQ(postgres.Int(id)))
|
||||
return db.ExecuteOne[model.TextLog](ctx, statement)
|
||||
}
|
||||
func TextLogsFromPhoneNumber(ctx context.Context, number string) ([]model.TextLog, error) {
|
||||
statement := table.TextLog.SELECT(
|
||||
table.TextLog.AllColumns,
|
||||
).FROM(table.TextLog).
|
||||
WHERE(table.TextLog.Source.EQ(postgres.String(number)).OR(
|
||||
table.TextLog.Destination.EQ(postgres.String(number))))
|
||||
return db.ExecuteMany[model.TextLog](ctx, statement)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue