feat: add connections page, composable, nav badge, and peer-support redirect

- useConnections composable wrapping all /api/connections endpoints
- Connections page with suggestions, filters, and connection management
- Pending connection count badge in sidebar navigation
- peer-support.vue now redirects to /connections
This commit is contained in:
Jennie Robinson Faber 2026-04-05 16:56:40 +01:00
parent dcb80e6006
commit ed33cbb9e7
4 changed files with 903 additions and 3 deletions

View file

@ -0,0 +1,32 @@
export const useConnections = () => {
const getSuggestions = (params = {}) =>
$fetch('/api/connections/suggestions', { params })
const getMyConnections = () =>
$fetch('/api/connections')
const requestConnection = (recipientId) =>
$fetch('/api/connections', { method: 'POST', body: { recipientId } })
const confirmConnection = (id) =>
$fetch(`/api/connections/${id}/confirm`, { method: 'POST' })
const hideConnection = (id) =>
$fetch(`/api/connections/${id}/hide`, { method: 'POST' })
const withdrawConnection = (id) =>
$fetch(`/api/connections/${id}/withdraw`, { method: 'POST' })
const getPendingCount = () =>
$fetch('/api/connections/pending-count')
return {
getSuggestions,
getMyConnections,
requestConnection,
confirmConnection,
hideConnection,
withdrawConnection,
getPendingCount,
}
}