ghostguild-org/app/composables/useConnections.js
Jennie Robinson Faber ed33cbb9e7 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
2026-04-05 16:56:40 +01:00

32 lines
871 B
JavaScript

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,
}
}