fix: resolve Sprint 8 compilation issues, Docker build green
This commit is contained in:
@@ -19,14 +19,9 @@ import {
|
||||
Square,
|
||||
Users,
|
||||
Vote,
|
||||
XCircle,
|
||||
} from "lucide-react"
|
||||
|
||||
import type {
|
||||
AssemblyDetail,
|
||||
AssemblyStatus,
|
||||
VoteResult,
|
||||
} from "@/services/assemblies"
|
||||
import type { AssemblyDetail, AssemblyStatus } from "@/services/assemblies"
|
||||
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Button } from "@/components/ui/button"
|
||||
@@ -56,6 +51,7 @@ export default function AssemblyDetailPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (id) loadDetail()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [id])
|
||||
|
||||
async function loadDetail() {
|
||||
|
||||
@@ -116,7 +116,11 @@ export default function AssembliesPage() {
|
||||
...prev,
|
||||
agendaItems: [
|
||||
...prev.agendaItems,
|
||||
{ title: "", description: "", itemType: "INFORMATION" as AgendaItemType },
|
||||
{
|
||||
title: "",
|
||||
description: "",
|
||||
itemType: "INFORMATION" as AgendaItemType,
|
||||
},
|
||||
],
|
||||
}))
|
||||
}
|
||||
@@ -132,7 +136,7 @@ export default function AssembliesPage() {
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
agendaItems: prev.agendaItems.map((item, i) =>
|
||||
i === index ? { ...item, [field]: value } : item,
|
||||
i === index ? { ...item, [field]: value } : item
|
||||
),
|
||||
}))
|
||||
}
|
||||
@@ -338,7 +342,7 @@ export default function AssembliesPage() {
|
||||
year: "numeric",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
},
|
||||
}
|
||||
)}
|
||||
{assembly.location && ` • ${assembly.location}`}
|
||||
</p>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { apiClient } from "@/lib/api-client"
|
||||
import { apiClient, apiDownload } from "@/lib/api-client"
|
||||
|
||||
export type AssemblyType = "ORDINARY" | "EXTRAORDINARY"
|
||||
export type AssemblyStatus =
|
||||
@@ -96,48 +96,40 @@ export interface CreateVoteRequest {
|
||||
// === API Functions ===
|
||||
|
||||
export async function getAssemblies(): Promise<Assembly[]> {
|
||||
const res = await apiClient.get("/api/v1/assemblies")
|
||||
return res.data
|
||||
return apiClient<Assembly[]>("/assemblies")
|
||||
}
|
||||
|
||||
export async function getAssemblyDetail(id: string): Promise<AssemblyDetail> {
|
||||
const res = await apiClient.get(`/api/v1/assemblies/${id}`)
|
||||
return res.data
|
||||
return apiClient<AssemblyDetail>(`/assemblies/${id}`)
|
||||
}
|
||||
|
||||
export async function createAssembly(
|
||||
data: CreateAssemblyRequest
|
||||
): Promise<Assembly> {
|
||||
const res = await apiClient.post("/api/v1/assemblies", data)
|
||||
return res.data
|
||||
return apiClient<Assembly>("/assemblies", { method: "POST", body: data })
|
||||
}
|
||||
|
||||
export async function updateAssembly(
|
||||
id: string,
|
||||
data: Partial<CreateAssemblyRequest>
|
||||
): Promise<Assembly> {
|
||||
const res = await apiClient.put(`/api/v1/assemblies/${id}`, data)
|
||||
return res.data
|
||||
return apiClient<Assembly>(`/assemblies/${id}`, { method: "PUT", body: data })
|
||||
}
|
||||
|
||||
export async function sendInvitations(id: string): Promise<Assembly> {
|
||||
const res = await apiClient.post(`/api/v1/assemblies/${id}/invite`)
|
||||
return res.data
|
||||
return apiClient<Assembly>(`/assemblies/${id}/invite`, { method: "POST" })
|
||||
}
|
||||
|
||||
export async function cancelAssembly(id: string): Promise<Assembly> {
|
||||
const res = await apiClient.post(`/api/v1/assemblies/${id}/cancel`)
|
||||
return res.data
|
||||
return apiClient<Assembly>(`/assemblies/${id}/cancel`, { method: "POST" })
|
||||
}
|
||||
|
||||
export async function startAssembly(id: string): Promise<Assembly> {
|
||||
const res = await apiClient.post(`/api/v1/assemblies/${id}/start`)
|
||||
return res.data
|
||||
return apiClient<Assembly>(`/assemblies/${id}/start`, { method: "POST" })
|
||||
}
|
||||
|
||||
export async function completeAssembly(id: string): Promise<Assembly> {
|
||||
const res = await apiClient.post(`/api/v1/assemblies/${id}/complete`)
|
||||
return res.data
|
||||
return apiClient<Assembly>(`/assemblies/${id}/complete`, { method: "POST" })
|
||||
}
|
||||
|
||||
export async function checkInAttendee(
|
||||
@@ -145,27 +137,24 @@ export async function checkInAttendee(
|
||||
memberId: string,
|
||||
proxyForMemberId?: string
|
||||
): Promise<Attendee> {
|
||||
const res = await apiClient.post(
|
||||
`/api/v1/assemblies/${assemblyId}/attendees`,
|
||||
{ memberId, proxyForMemberId }
|
||||
)
|
||||
return res.data
|
||||
return apiClient<Attendee>(`/assemblies/${assemblyId}/attendees`, {
|
||||
method: "POST",
|
||||
body: { memberId, proxyForMemberId },
|
||||
})
|
||||
}
|
||||
|
||||
export async function getAttendees(assemblyId: string): Promise<Attendee[]> {
|
||||
const res = await apiClient.get(`/api/v1/assemblies/${assemblyId}/attendees`)
|
||||
return res.data
|
||||
return apiClient<Attendee[]>(`/assemblies/${assemblyId}/attendees`)
|
||||
}
|
||||
|
||||
export async function createVote(
|
||||
assemblyId: string,
|
||||
data: CreateVoteRequest
|
||||
): Promise<AssemblyVote> {
|
||||
const res = await apiClient.post(
|
||||
`/api/v1/assemblies/${assemblyId}/votes`,
|
||||
data
|
||||
)
|
||||
return res.data
|
||||
return apiClient<AssemblyVote>(`/assemblies/${assemblyId}/votes`, {
|
||||
method: "POST",
|
||||
body: data,
|
||||
})
|
||||
}
|
||||
|
||||
export async function castVote(
|
||||
@@ -173,34 +162,30 @@ export async function castVote(
|
||||
memberId: string,
|
||||
decision: VoteDecision
|
||||
): Promise<AssemblyVote> {
|
||||
const res = await apiClient.post(`/api/v1/assemblies/votes/${voteId}/cast`, {
|
||||
memberId,
|
||||
decision,
|
||||
return apiClient<AssemblyVote>(`/assemblies/votes/${voteId}/cast`, {
|
||||
method: "POST",
|
||||
body: { memberId, decision },
|
||||
})
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function closeVote(voteId: string): Promise<AssemblyVote> {
|
||||
const res = await apiClient.post(`/api/v1/assemblies/votes/${voteId}/close`)
|
||||
return res.data
|
||||
return apiClient<AssemblyVote>(`/assemblies/votes/${voteId}/close`, {
|
||||
method: "POST",
|
||||
})
|
||||
}
|
||||
|
||||
export async function downloadProtocol(assemblyId: string): Promise<Blob> {
|
||||
const res = await apiClient.get(`/api/v1/assemblies/${assemblyId}/protocol`, {
|
||||
responseType: "blob",
|
||||
})
|
||||
return res.data
|
||||
const { blob } = await apiDownload(`/assemblies/${assemblyId}/protocol`)
|
||||
return blob
|
||||
}
|
||||
|
||||
// Portal
|
||||
export async function getPortalAssemblies(): Promise<Assembly[]> {
|
||||
const res = await apiClient.get("/api/v1/portal/assemblies")
|
||||
return res.data
|
||||
return apiClient<Assembly[]>("/portal/assemblies")
|
||||
}
|
||||
|
||||
export async function getPortalAssemblyDetail(
|
||||
id: string
|
||||
): Promise<AssemblyDetail> {
|
||||
const res = await apiClient.get(`/api/v1/portal/assemblies/${id}`)
|
||||
return res.data
|
||||
return apiClient<AssemblyDetail>(`/portal/assemblies/${id}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user