mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat: add session pinning for pinned/recent session groups (#301)
* feat: add session pinning for pinned/recent session groups * refactor: extract buildSessionKey, deduplicate SessionCard rendering, clean up pins on delete
This commit is contained in:
1 parent
217f5bd989
commit
a9b6f7ce46
21 files changed
+762
-58
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { fetchWrapper } from './fetchWrapper'
|
||||
import { API_BASE_URL } from '@/config'
|
||||
import type { SessionPin, ToggleSessionPinRequest } from '@opencode-manager/shared/schemas'
|
||||
|
||||
export async function listSessionPins(): Promise<SessionPin[]> {
|
||||
const res = await fetchWrapper<{ pins: SessionPin[] }>(`${API_BASE_URL}/api/session-pins`)
|
||||
return res.pins
|
||||
}
|
||||
|
||||
export async function toggleSessionPin(input: ToggleSessionPinRequest): Promise<SessionPin[]> {
|
||||
const res = await fetchWrapper<{ pins: SessionPin[] }>(`${API_BASE_URL}/api/session-pins`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(input),
|
||||
})
|
||||
return res.pins
|
||||
}
|
||||
Reference in new issue
Block a user