This commit is contained in:
2026-06-13 17:57:43 +08:00
parent 68678304ff
commit a0f441d8ae
28 changed files with 1933 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
import api from './client'
export interface CapsuleCreateData {
recipient_id: string
title: string
content: string
unlock_at: string
mood?: string
}
export const capsulesApi = {
getAll: () => api.get('/capsules/'),
getOne: (id: string) => api.get(`/capsules/${id}`),
create: (data: CapsuleCreateData) => api.post('/capsules/', data),
}
+10
View File
@@ -0,0 +1,10 @@
import api from './client'
export const leavesApi = {
getToday: () => api.get('/leaves/today'),
updateLeaf: (leafId: string, data: { mood?: string; note?: string }) =>
api.put(`/leaves/${leafId}`, data),
getCollection: () => api.get('/leaves/collection'),
}
+9
View File
@@ -0,0 +1,9 @@
import api from './client'
export const treesApi = {
getAll: () => api.get('/trees/'),
getTree: (friendId: string) => api.get(`/trees/${friendId}`),
water: (friendId: string) => api.post(`/trees/${friendId}/water`),
}