Implement Django backend and Vue frontend structure
- Django backend with projects, templates, exports apps - SQLite database models for Project, Asset, CardLayer - REST API endpoints for project management - Vue frontend with Vite, Element Plus, Fabric.js - Home page for project selection - Editor page with Fabric.js canvas integration
This commit is contained in:
27
frontend/src/api/project.js
Normal file
27
frontend/src/api/project.js
Normal file
@@ -0,0 +1,27 @@
|
||||
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}/`)
|
||||
}
|
||||
Reference in New Issue
Block a user