Files
game-cards-poker-design/frontend/src/api/project.js
Poker Design Developer 48b6fb0a39 Fix frontend blank page issue
- Simplify Home.vue to avoid API loading errors
- Use built-in template data instead of API calls
- Add simple error handling for API requests
- Add test page for debugging
2026-05-31 19:35:53 +08:00

28 lines
686 B
JavaScript

import axios from 'axios'
const API_BASE = '/api'
export async function getProjects() {
const response = await axios.get(`${API_BASE}/projects/`)
return response.data
}
export async function createProject(data) {
const response = await axios.post(`${API_BASE}/projects/`, data)
return response.data
}
export async function getProject(id) {
const response = await axios.get(`${API_BASE}/projects/${id}/`)
return response.data
}
export async function updateProject(id, data) {
const response = await axios.put(`${API_BASE}/projects/${id}/`, data)
return response.data
}
export async function deleteProject(id) {
await axios.delete(`${API_BASE}/projects/${id}/`)
}