1.6
This commit is contained in:
@@ -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),
|
||||
}
|
||||
@@ -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'),
|
||||
}
|
||||
@@ -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`),
|
||||
}
|
||||
Reference in New Issue
Block a user