60e83d49dd
- Replace Vite boilerplate with React Router for page navigation - Add React Query for server state and cache management - Integrate shadcn/ui component library with Tailwind CSS v4 - Configure @/ path alias for clean module imports - Set up Vite dev proxy to API backend - Remove default App.css, App.tsx, and react.svg assets
23 lines
821 B
TypeScript
23 lines
821 B
TypeScript
import client from "./client"
|
|
import type { ApiResultListMyBorrowVo, ApiResultMyBorrowVo, ApiResultString } from "@/types/api"
|
|
|
|
export function getAllMyBorrows() {
|
|
return client.get<ApiResultListMyBorrowVo>("/api/borrows/getall")
|
|
}
|
|
|
|
export function getOneMyBorrow(borrowId: number) {
|
|
return client.get<ApiResultMyBorrowVo>("/api/borrows/getone", { params: { borrowId } })
|
|
}
|
|
|
|
export function searchMyBorrows(query: string) {
|
|
return client.get<ApiResultListMyBorrowVo>("/api/borrows/search", { params: { query } })
|
|
}
|
|
|
|
export function borrowBookForMe(bookId: number) {
|
|
return client.post<ApiResultString>("/api/borrows/borrowbook", null, { params: { bookId } })
|
|
}
|
|
|
|
export function returnBookForMe(borrowId: number) {
|
|
return client.post<ApiResultString>("/api/borrows/returnbook", null, { params: { borrowId } })
|
|
}
|