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