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:
parent
dcb80e6006
commit
ed33cbb9e7
4 changed files with 903 additions and 3 deletions
32
app/composables/useConnections.js
Normal file
32
app/composables/useConnections.js
Normal 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,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue