user no stays in cache forever, fix some hubs bugs and add new enpoints
This commit is contained in:
@@ -181,6 +181,19 @@ func ConnectionDelete(ctx context.Context, conn *types.Connection) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func ConnectionGetById(ctx context.Context, id uuid.UUID) (*types.Connection, error) {
|
||||
conn := types.NewConn()
|
||||
err := dbConn.QueryRow(ctx, `
|
||||
SELECT id, requestor_id, recipient_id, state, created_at
|
||||
FROM user_connections
|
||||
WHERE id = $1
|
||||
`, id).Scan(&conn.Id, &conn.RequestorId, &conn.RecipientId, &conn.State, &conn.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return conn, nil
|
||||
}
|
||||
|
||||
func ConnectionsGetBelongingToUser(ctx context.Context, user *types.User) error {
|
||||
rows, err := dbConn.Query(ctx, `
|
||||
SELECT id, requestor_id, recipient_id, state, created_at
|
||||
|
||||
Reference in New Issue
Block a user