This commit is contained in:
Veljko Tosic
2026-02-16 18:18:21 +01:00
parent c200847c17
commit 5d148db4da
17 changed files with 399 additions and 15 deletions

View File

@@ -0,0 +1,27 @@
import type { Whiteboard } from "@/types";
import { api } from './api'
export const whiteboardService = {
async getWhiteboardHistory(): Promise<Whiteboard[]> {
const raw = await api.get<any[]>('/api/Whiteboard/history')
return raw.map(mapWhiteboard)
},
async getRecentWhiteboards(): Promise<Whiteboard[]> {
const raw = await api.get<any[]>('/api/Whiteboard/recent')
return raw.map(mapWhiteboard)
}
}
function mapWhiteboard(raw: any): Whiteboard {
return {
id: raw.id,
ownerId: raw.ownerId,
title: raw.title,
createdAt: new Date(raw.createdAt),
deletedAt: raw.deletedAt ? new Date(raw.deletedAt) : undefined,
maxParticipants: raw.maxParticipants,
joinPolicy: raw.joinPolicy,
state: raw.state,
}
}