Added transaction feature, fixed some mistakes
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export interface Family {
|
||||
id: number
|
||||
name: string
|
||||
owner_id: number
|
||||
telegram_chat_id: number | null
|
||||
telegram_chat_name: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export async function getFamilyById(id: number): Promise<Family> {
|
||||
const response = await fetch(`/api/v1/families/${id}`)
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch family: ${response.status}`)
|
||||
}
|
||||
|
||||
return response.json() as Promise<Family>
|
||||
}
|
||||
Reference in New Issue
Block a user