feat: initialize app with routing, query management, and UI framework
- 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
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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 } })
|
||||
}
|
||||
Reference in New Issue
Block a user