user no stays in cache forever, fix some hubs bugs and add new enpoints

This commit is contained in:
2026-05-04 14:03:02 +02:00
parent 22e2d18810
commit 015c79bf09
14 changed files with 260 additions and 34 deletions
+13
View File
@@ -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